How to Change the SSL Key in Subsonic 4.4.beta1

Tutorials, tips and tricks.

Moderator: moderators

How to Change the SSL Key in Subsonic 4.4.beta1

Postby seanpkeown » Wed Jan 19, 2011 3:00 am

By default subsonic 4.4.beta1 comes with SSL built in but it looks as if everyone has the same encryption key. << I could be wrong about this.

1st.)
To change this key first stop the subsonic service then browse to.
C:\Program Files\Subsonic << for a 32bit system
or
C:\Program Files (x86)\Subsonic << for a 64bit system

2nd.)
Next drag subsonic-booter-jar-with-dependencies.jar to your desktop since some windows vista and 7 systems block this file from being edited from the C:\Program Files folder for security reasons.

3rd.)
Then from the desktop open the subsonic-booter-jar-with-dependencies.jar file with winwar or 7zip. You should now see a file called subsonic.keystore. Drag that file somewhere to back it up in case you have any problems.


4th.)
Next open command prompt and paste the following code to start creating a new encryption key making sure that you change the fields in red.

>>"C:\Program Files\Java\jre6\bin\keytool" -genkey -alias tomcat -keyalg RSA -dname "CN=domainname, OU=Subsonic, O=Loving Music Inc, L=City, S=State, C=US" -validity 3650 -keystore %USERPROFILE%\Desktop\subsonic.keystore -storepass subsonic -keypass subsonic<< Code is in between the arrows.

Code Meaning
CN=commonName "Domain Name"
OU=organizationUnit "Department or Division"
O=organizationName "Company Inc"
L=localityName "City Name"
S=stateName "State Name"
C=country "Country Code i.e US"

5th.) There should be a file called subsonic.keystore on your desktop now. With winrar or 7zip still open drag the file into the archive subsonic-booter-jar-with-dependencies.jar overwritting the old subsonic.keystore.

6th.) Then drag subsonic-booter-jar-with-dependencies.jar back to

C:\Program Files\Subsonic << for a 32bit system
or
C:\Program Files (x86)\Subsonic << for a 64bit system

7th.) Then start the subsonic service backup.




Let me know if i made any mistakes and i'll update.

Thanks,
Sean K
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby seedoubleyou » Sat Jan 29, 2011 12:17 pm

worked all the way until it was time to re-add the file with 7-Zip and received a 'memory allocation error'

tried in different folders and NG.. don't want to install Winzip simply for this..

perhaps you want to generate a custom key for us? :)
seedoubleyou
 
Posts: 6
Joined: Sat Jan 29, 2011 12:15 pm

Postby seanpkeown » Tue Feb 01, 2011 1:36 am

seedoubleyou wrote:worked all the way until it was time to re-add the file with 7-Zip and received a 'memory allocation error'

tried in different folders and NG.. don't want to install Winzip simply for this..

perhaps you want to generate a custom key for us? :)


Hi seedoubleyou,
If i created a custom key for everyone then you would still have the same problem. It would be the same as if you changed the keys on your home but then shared them with everyone. Unless you were asking me to create you a custom key? :wink:

When you went to copy the new subsonic.keystore into the subsonic-booter-jar-with-dependencies.jar did you first stop the subsonic service and then copy subsonic-booter-jar-with-dependencies.jar to your desktop? - Just wondering?
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby meanaverage » Fri Feb 18, 2011 6:14 pm

Thanks for this. This was very useful! Your instructions worked perfectly.
meanaverage
 
Posts: 10
Joined: Thu Feb 17, 2011 11:49 pm

Postby seedoubleyou » Fri Feb 18, 2011 6:15 pm

sorry..i never followed up with my solution, which was to make sure you're running the latest version of 7zip to perform the file operations. Once I updated my 7-zip installation, everything went smoothly.

thanks for your help!
seedoubleyou
 
Posts: 6
Joined: Sat Jan 29, 2011 12:15 pm

Real SSL certificate?

Postby hogfan » Tue Feb 22, 2011 5:56 am

Has anybody got this working with a real SSL certificate yet (not a self-signed)? I don't want to generate a new RSA key. I have been able to use keytool to export my free startssl.com certificate to a .keystore file, but whenever I put that in the .JAR file after renaming it to subsonic.keystore, subsonic is able to be started, but I'm no longer able to access the web interface. Does the -alias have to be "tomcat" of the keystore file? Thanks for any help.

-hogfan
hogfan
 
Posts: 30
Joined: Tue Jan 25, 2011 2:31 am
Location: Little Rock, AR

Re: Real SSL certificate?

Postby meanaverage » Tue Feb 22, 2011 10:37 pm

hogfan wrote:Has anybody got this working with a real SSL certificate yet (not a self-signed)? I don't want to generate a new RSA key. I have been able to use keytool to export my free startssl.com certificate to a .keystore file, but whenever I put that in the .JAR file after renaming it to subsonic.keystore, subsonic is able to be started, but I'm no longer able to access the web interface. Does the -alias have to be "tomcat" of the keystore file? Thanks for any help.

-hogfan


Hogfan, keystores are accessed via a keystore alias. If you don't use the tomcat alias for your keystore then it won't work... unless you were to change the keystore alias in subsonic -- but I have no idea where that's located.

If you do change the keystore alias (keytool -alias tomcat), I'd be interested to know if your startssl.com cert does function or if it runs into any other issues.
meanaverage
 
Posts: 10
Joined: Thu Feb 17, 2011 11:49 pm

Got it working

Postby Linklater » Wed Feb 23, 2011 3:10 am

Got it working with a legit signed key.

If you have a pfx key, use pkcs12import to get it into the java keystore. Make sure the key password, keystore password, and key alias are all "subsonic" without the quotes.

http://download.oracle.com/docs/cd/E178 ... l#wp526882
Linklater
 
Posts: 2
Joined: Wed Jul 07, 2010 4:54 pm

Postby hogfan » Wed Feb 23, 2011 4:25 am

Ok, well this time I'm getting something different.........I did the following:

Code: Select all
sudo keytool -import -trustcacerts -alias tomcat -file /etc/ssl/certs/mycert.crt -keystore subsonic.keystore -storepass subsonic -keypass subsonic


I put that in the .JAR and put it back in my "/usr/share/subsonic" folder and started the service back up. This time the page just keeps trying to load. Just spins and status bar says "Connected to mysite" Any suggestions? I notice the user who posted above said to use "subsonic" as the alias rather than Tomcat. Which alias should I be using for Subsonic 4.4? This is turning into a nightmare to get this working. I wanting to use a real SSL cert such a bad thing?

-hogfan
hogfan
 
Posts: 30
Joined: Tue Jan 25, 2011 2:31 am
Location: Little Rock, AR

Update

Postby hogfan » Wed Feb 23, 2011 4:36 am

Tried it again, this time using "subsonic" as the -alias when importing the key and still getting the same results.

-hogfan
hogfan
 
Posts: 30
Joined: Tue Jan 25, 2011 2:31 am
Location: Little Rock, AR

Postby meanaverage » Wed Feb 23, 2011 8:15 pm

hogfan wrote:Ok, well this time I'm getting something different.........I did the following:

Code: Select all
sudo keytool -import -trustcacerts -alias tomcat -file /etc/ssl/certs/mycert.crt -keystore subsonic.keystore -storepass subsonic -keypass subsonic


I put that in the .JAR and put it back in my "/usr/share/subsonic" folder and started the service back up. This time the page just keeps trying to load. Just spins and status bar says "Connected to mysite" Any suggestions? I notice the user who posted above said to use "subsonic" as the alias rather than Tomcat. Which alias should I be using for Subsonic 4.4? This is turning into a nightmare to get this working. I wanting to use a real SSL cert such a bad thing?

-hogfan


I'm not an expert on this, but since LinkLater had success, maybe try the following:

1. Convert your certificate to a PKCS12#12 format using: https://www.sslshopper.com/ssl-converter.html
2. Use PKCS12import per LinkLater's instructions.
meanaverage
 
Posts: 10
Joined: Thu Feb 17, 2011 11:49 pm

Postby meanaverage » Wed Feb 23, 2011 8:18 pm

Linklater and hogfan, which OS and version are you running this on?
meanaverage
 
Posts: 10
Joined: Thu Feb 17, 2011 11:49 pm

Ubuntu Maverick Server......

Postby hogfan » Thu Feb 24, 2011 5:32 am

I'm running on Ubuntu 10.10 Server (Maverick). Subsonic version is 4.4 final.

-hogfan
hogfan
 
Posts: 30
Joined: Tue Jan 25, 2011 2:31 am
Location: Little Rock, AR

Postby seanpkeown » Sun Feb 27, 2011 10:59 pm

Give Portecle a try. Its a gui for the java keytool and might make it easier when creating and importing certificates.

http://portecle.sourceforge.net/


~ Sean K
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby chemikalguy » Tue Mar 29, 2011 6:20 pm

Does this work in 4.4, or does it have to be 4.4beta1? I'm trying it, but it doesn't seem to be working. I had some 7-zip errors like the previous posted, so I used WinRAR, which seemed to work. When I restarted and opened the web page, I got the same error, and it still listed the domain as *.subsonic.org. I have gotten my own StartSSL certificate, so I want to use that if I can.
chemikalguy
 
Posts: 26
Joined: Thu Mar 24, 2011 8:33 pm
Location: Durham, NC, USA

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest