Glassfishインスタンス停止
$ asadmin stop-domain $ cd /usr/local/glassfish4/glassfish/domains/domain1/config
$ vim servercert.der
-----BEGIN CERTIFICATE----- <<省略>> -----END CERTIFICATE-----
$ vim cacerts.x509
-----BEGIN CERTIFICATE----- <<省略>> -----END CERTIFICATE-----
$ mkdir cert $ mv servercert.der cert $ mv cacerts.x509 cert $ mv back.jutakutenjijo.com.key cert
$ mkdir bak $ mv keystore.jks bak $ mv cacerts.jks bak
$ openssl pkcs12 -export -in cert/servercert.der -inkey cert/server.key -out keystore.pkcs12 -name "s1as"
Enter pass phrase for cert/server.key: Enter Export Password: Verifying - Enter Export Password:
※private pass phrase
$ keytool -importkeystore -srckeystore keystore.pkcs12 -destkeystore keystore.jks -srcstoretype pkcs12 -deststoretype jks Enter destination keystore password: Re-enter new password: Enter source keystore password: Entry for alias s1as successfully imported. Import command completed: 1 entries successfully imported, 0 entries failed or cancelled
keytool -import -file cert/cacerts.x509 -trustcacerts -alias s1as -keystore cacerts.jks Enter keystore password: Re-enter new password: Certificate was added to keystore
$ keytool -list -keystore keystore.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry s1as, Oct 23, 2014, PrivateKeyEntry, Certificate fingerprint (SHA1): D9:C3:21:0B:E7:16:50:3B:C0:C9:36:31:CC:AC:AA:79:63:BB:63:89
$ keytool -list -keystore cacerts.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry s1as, Oct 23, 2014, trustedCertEntry, Certificate fingerprint (SHA1): C0:39:A3:26:9E:E4:B8:E8:2D:00:C5:3F:A7:97:B5:A1:9E:83:6F:47
$ asadmin start-domain $ asadmin disable-secure-admin $ asadmin stop-domain $ asadmin start-domain $ asadmin enable-secure-admin --adminalias=s1as --instancealias=s1as $ asadmin stop-domain $ asadmin start-domain