replace SSL cert (Ubuntu)

Need help? Post your questions here.

Moderator: moderators

Postby humvee » Thu Feb 24, 2011 10:44 pm

@hogfan
I tried:
keytool -import -alias root -keystore mysubsonic.keystore -trustcacerts -file privateAndCert.key

and
keytool -import -alias root -keystore mysubsonic.keystore -trustcacerts -file onlyCert.crt

and
keytool -import -alias tomcat -keystore mysubsonic.keystore -trustcacerts -file onlyCert.crt


on every action i have to enter a password, I always typed "subsonic" as password, I have to put a word longer than 6 chars in.

but both doesn't work :/
i can't access subsonic on https port (my port settings are correct), :/

thx,
greetings,
humvee
humvee
 
Posts: 5
Joined: Tue Feb 15, 2011 8:39 pm
Location: Germany

Postby seanpkeown » Mon Feb 28, 2011 1:20 am

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/
seanpkeown
 
Posts: 100
Joined: Tue Jun 09, 2009 10:41 pm

Postby humvee » Wed Mar 16, 2011 12:51 am

Now I've downloaded that tool and did:
- New keystroke
- JKS
- Tools
- Import Trustet Cert

I tried both variants:
1:
Code: Select all
-----BEGIN RSA PRIVATE KEY-----
theKey
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
theCert
-----END CERTIFICATE-----


and 2:
Code: Select all
-----BEGIN CERTIFICATE-----
theCert
-----END CERTIFICATE-----


in the first example i named the key in the keystore: "tomcat" and in number two i named it like my server-host.

then i saved the keystore. pwd was subsonic.

after that I can't connect to http and https.
but the log of subsonic says that the sockets (ssl and non-ssl) started correctly.


now i have no idea where the problem could be :/
the jar file has the owner root and the chmod 755

tanks for your answers.
humvee
 
Posts: 5
Joined: Tue Feb 15, 2011 8:39 pm
Location: Germany

Re: replace SSL cert (Ubuntu)

Postby karrth » Mon Feb 03, 2014 9:59 pm

Solution on Debian:

1) stop subsonic
Code: Select all
service subsonic stop

2) Backup the jar file as well:
Code: Select all
cd /usr/share/subsonic/
cp subsonic-booter-jar-with-dependencies.jar subsonic-booter-jar-with-dependencies.jar.bak

3) extract the subsonic.keystore:
Code: Select all
jar xf subsonic-booter-jar-with-dependencies.jar subsonic.keystore

4) Remove the current cert in the keystore:
Code: Select all
keytool -delete -alias subsonic -keystore subsonic.keystore

5) add your crt to the keystore, replace "mydomain.crt" with your crt filename. Password when prompted is "subsonic":
Code: Select all
keytool -import -trustcacerts -alias subsonic -file mydomain.crt -keystore subsonic.keystore

6) Add the keystore back into the jar file:
Code: Select all
jar uf subsonic-booter-jar-with-dependencies.jar subsonic.keystore

7) Boot up Subsonic again
Code: Select all
service subsonic start


You might want to keep a copy of the keystore somewhere for easy re-insertion when you upgrade Subsonic.

Helpful links:
viewtopic.php?t=5295
http://www.sslshopper.com/article-most- ... mands.html
http://docs.oracle.com/javase/tutorial/ ... pdate.html
http://docs.oracle.com/javase/tutorial/ ... npack.html
karrth
 
Posts: 1
Joined: Mon Feb 03, 2014 9:46 pm

Previous

Return to Help

Who is online

Users browsing this forum: No registered users and 72 guests