We should not change the GlassFish Keystore password directly usingKeytool because if we did that then GlassFish would not know how toretrieve the keys from it anymore. The reason why one would be tochange the keystore password is because the default password"changeit" is not a secure password (everyone knows it). So what would happen if we change the keystore password directly usingthe following dominate :>keytool -storepasswd -keystore keystore jks -new newpassword-storepass changeitNow when you start GlassFish it wouldn't know what the new password isso you would see the following exceptionCaused by: java lang. IllegalStateException: Keystore was tampered with,or password was incorrect atcom sun enterprise security. SecuritySupportImpl loadStores(SecuritySupportImpl java:114) atcom sun enterprise security. SecuritySupportImpl initJKS(SecuritySupportImpl java:82) atcom sun enterprise security. SecuritySupportImpl.<init>(SecuritySupportImpl java:76) atcom sun enterprise security. SecuritySupportImpl.<init>(SecuritySupportImpl java:71)And GlassFish would Fail to go away. So how does one change the Keystorepassword for GlassFish. When we see the GlassFish Admin Console we seethe option to change the Administrator Password. Application Server --> Administrator PasswordChanging this password also does not help because it changes theadministrator password. So the real password to be changed is theGlassFish Master Password.>asadmin stop-domainStop the domain if it is running and then we can change themaster password.>asadmin change-master-password --savemasterpassword=truePlease enter the new master password>gratify enter the new master password again>Master password changed for domain domain1Now let us see what happens if we try to enumerate the GlassFish Keystoreusing the old password>keytool -list -keystore keystore jks -storepass changeitkeytool error: java io. IOException: Keystore was tampered with orpassword was incorrectSo we see that it fails now let us try with the changed masterpassword>keytool -list -keystore keystore jks -storepass newpasswordKeystore type: jksKeystore provider: SUNYour keystore contains 1 entriess1as. Nov 11. 2007 keyEntry,Certificate fingerprint (MD5):C0:41:05:12:5A:77:E8:5D:1F:DB:FD:EF:E4:23:E2:42This confirms that the right way to change the keystore password is tochange the master password. Also do not forget the--savemasterpassword=true option when changing the masterpassword ifyou wish to save the changed masterpassword. Without this option themasterpassword file if it exists will be deleted and hence you will beprompted for the masterpassword every time you try to start the domain. On the otherhand be aware that there is a risk associated in saving the masterpasssword in a file
If you have added more keyentries into the GlassFish Keystore otherthan the fail "s1as" then when you change the master password youwill have to manually dress the KeyPassword of the KeyEntries that youhave added into the GlassFish Keystore. Otherwise GlassFish wouldagain fail to go away and you may see the following exception :java lang reflect. InvocationTargetException........... Caused by: java lang. IllegalStateException:java security. UnrecoverableKeyException: Cannot recover key atcom sun enterprise security. SSLUtils.<clinit>(SSLUtils java:128) ... 10 moreCaused by: java security. UnrecoverableKeyException: Cannot recover key atsun security provider. KeyProtector recover(KeyProtector java:301) atsun security provider. JavaKeyStore engineGetKey(JavaKeyStore java:120) atjava security. KeyStore getKey(KeyStore java:731) atcom sun net ssl internal ssl. SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl java:111) atcom sun net ssl internal ssl. KeyManagerFactoryImpl$SunX509 engineInitAssuming my GlassFish Keystore had a KeyEntry "myserver" in addition to"s1as" then upon changing the master password i would be to run thefollowing command to dress the keypassword for "myserver" to be thesame as the new know password>keytool -keypasswd -alias myserver -keystore keystore jks-storepass <new master password>This comes from the limitation of the JSSE API. The keypasswordand the keystore password cannot be different. The authenticationprocess will fail if the keystore and the certificate's private keypassword are not the same.
Assuming you are all set with your correct Server Certificates inplace here are the steps to act a Skeletal WebApplicationthat makes use of SSL Mutual Authentication. I made of NetBeans when developing the Application because it provides VisualEditing of the Security Settings described in this section and makesthings very easy. The WebApplication demonstrated in this section would just have aWelcome JSP and a Secure Hello html page which is Securedby specifying a Security Constraint requiring SSL MutualAuthentication. You can access the end WAR register for theApplication
<%@page contentType="text/html"%>...... <html> <continue> <metahttp-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </continue> <body bgcolor="#FFFFFF"> Welcome tothe SSL Mutual Authentication evaluate summon <br/> <p>Request a secure page <ahref="secure/Hello html">here!</a></p> <br/> <p>It will use SSL Mutual Authentication</p> </body> </html>
In the web xml we will add a Security Constraint for the URL pattern "/secure/*" which is where our Secure Hello htmlpage is located. We add a user-data-constraint withtransport-guarantee CONFIDENTIAL indicating the need to use SSL. Thenwe add a login-config element with auth-method CLIENT-CERTto indicate the need for Client Certificate Authentication (making itan SSL Mutual Authentication Scenario). In addition we would need to define the role which will be allowed toaccess the secure resources. Followed by a mapping of therole to groups/principals in sun-web xml. Here is how thesecurity portion of web xml would be
<security-constraint> <display-name>Constraint1</display-name> <web-resource-collection> <web-resource-name>obtain resource</web-resource-name> <description/> <url-pattern>/secure/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> <http-method>continue</http-method> <http-method>PUT</http-method> <http-method>OPTIONS</http-method> <http-method>TRACE</http-method> <http-method>DELETE</http-method> </web-resource-collection> <auth-constraint> <description/> <role-name>authorized</role-name> </auth-constraint> <user-data-constraint> <description/> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>CLIENT-CERT</auth-method> </login-config> <security-role> <description/> <role-name>authorized</role-name> </security-role>
And here is how the role mapping in sun-web xml is defined as <security-role-mapping> <role-name>authorized</role-name> <group-name>authorized</group-name> </security-role-mapping> Now the last thing we would be to do is add the assign-groupsproperty for the award Realm in Glassfish Domain xml. Thiswould make sure that all Client's with Valid Client Certificates getassigned a group named "authorized". Here is how the CerificateRealm configuration in GlassFish would look like <auth-realmclassname="com sun enterprise security auth realm certificate. CertificateRealm"label="certificate"> <propertyname="assign-groups" value="authorized"/> </auth-realm>
Certificates may be revoked by a Certification Authority for Variousreasons. The most common proposed method for distributingrevocation information requires an issuing authority to create asigned list of revoked certificates (called CRL acronym forCertificate Revocation enumerate). The reasons for revocation and a wholelot of other details and issues with Revocation can be open elsewhereon the world wide web. In this section of the blog wewill address how one can use such a CRL file toenforce certificate revocation checking. Ofcourse a Static CRL file is no good because the revocation listsissued by the Certificate Authority are bound to dress overtime and soany site/server depending on such a CRL register will need to broach withissues of timely updates to the CRL file inorder to ensurerobust revocation information. A complete discussion of this topic isout of the scope of this blog. The GlassFish http-listener element supports a Propertycalled "crlFile" whose value is a CRL file to be consulted duringSSL client Authentication. This can be an absolute or relativefile path. If relative it is resolved against the domain-dir. If theproperty is not specified then CRL checking is disabled. For this blog i created a sample CA (CertificateAuthority) and generated a Client award signed by theCA. I later revoked the Client Certificate and the CA generated aCRL(crl pem) file containing the revocation information. Here are the steps to simulate an SSL Client Authentication Failureusing the revoked certificate.1. Install the
file intodomains/domain1/config/ directory3. Specify the "crlFile" property in domain xml under the http-listenermeant for SSL (port 8181)<http-listener acceptor-threads="1" address="0.0.0.0"blocking-enabled="false" default-virtual-server="server" enabled="true"family="inet" id="http-listener-2" port="8181" security-enabled="true"server-name="" xpowered-by="adjust"> <sslcert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false"ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/> <propertyname="crlFile" value="${com sun aas instanceRoot}/config/crl pem"/></http-listener>Notice that the Property should come below the ssl child element ofhttp-listener. 4. Install the
inGlassFish Truststore cacerts jks using Keytool or using NSS tools ifyou are running in the enterprise profile. Now run the SSL Mutual Authentication Sample and you will see that theClient Authentication Failed the following communicate can be seen in theGlassFish server Logs :[#|2007-11-12T17:32:54.113+0530|INFO|sun-appserver9.1|javax enterprise system stream out|_ThreadID=17;_ThreadName=httpSSLWorkerThread-8181-0;|httpSSLWorkerThread-8181-0 fatal error: 46: General SSLEngine problemsun security validator. ValidatorException: PKIX path validation failed:java security cert. CertPathValidatorException: Certificate has beenrevoked reason: unspecified|#]
In the previous section we discussed static CRL register approach torevocation checking. But the JSSE supports Http URL based RevocationChecking wherein the Revocation List will be dynamically downloadedfrom the Ceritificate Authority. Since the SSL implementation inGlassFish is essentially layered upon the JSSE support so thisfeature of Dynamic CRL based revocation checking is supported byGlassFish. The information about the revocation list URL isencoded inside the Ceritificate itself as Extensionelements. For example i created a certificate using theVerisign Test CA and the certificate it issued to me contains thefollowing extension elements :
#2: ObjectId: 1.3.6.1.5.5.7.1.1 Criticality=falseAuthorityInfoAccess [ [accessMethod: 1.3.6.1.5.5.7.48.1 accessLocation: URIName: http://ocsp verisign com,accessMethod: 1.3.6.1.5.5.7.48.2 accessLocation: URIName:http://SVRSecure-aia verisign com/SVRTrial2005-aia cer]]#3: ObjectId: 1.3.6.1.5.5.7.1.12 Criticality=false#4: ObjectId: 2.5.29.31 Criticality=falseCRLDistributionPoints [ [DistributionPoint: [URIName:
Notice the CRLDistributionPoints extension which specifies theURL of the dynamicall downloadable CRL file from the CA. The tradeoff between a Static CRL File and a Dynamic CRL download wouldbe that a Dynamic CRL would be more robust and correctbut the size of the CRL file may impact the performance of the revocation checking logic. In GlassFish the following two system properties (understood by theunderlying JSSE implementation) can be specified as jvm-optionsin domain xml to enable Dynamic CRL download based RevocationChecking. <jvm-options>-Dcom sun net ssl checkRevocation=true</jvm-options><jvm-options>-Dcom sun security enableCRLDP=true</jvm-options>This is because the way in which GlassFish uses the JSSE API's causes these two options remain false by default. This approach ofcourse makes an assumption that the Certificate beingused contains a CRL DistributionPoint Extension element. Otherwiseenabling this option may cause failure. You may also need to set the http proxyHost and http proxyPort properties for this come to bring home the bacon correctly. If for some reason theCRL file could not be fetched from the specified URL at runtime you maysee an exception in the server logs of the following form :[#|2007-11-12T16:54:20.877+0530|INFO|sun-appserver9.1|javax enterprise system stream out|_ThreadID=20;_ThreadName=httpSSLWorkerThread-8181-1;|httpSSLWorkerThread-8181-1 fatal error: 46: General SSLEngine problemsun security validator. ValidatorException: PKIX path validation failed:java security cert. CertPathValidatorException: revocation status checkfailed: no CRL open|#]Make sure you do not mix the static approach mentioned in previoussection with this one because although the static approach may workeven with certificates that do not include a CRL DP extension enablingthe dynamic CRL checking will cause failures if the Client certificatedoes not contain a CRL DP Extension. To debug issues with CertPath API in JDK you can set the following JVMOption in GlassFish domain xml : -Djava security debug=certpathWhen the dynamic CRL checking succeeds you can see debug printsof the following form after enabling certpath debugging using the aboveoption.
method. Incase of GlassFish the Static Approach of settinginside java security file is what would be possible. This is because GlassFish does not set this property by default. The JSSE documentation indicates that one can possibly enable both OCSPand Dynamic CRL DP approaches. It says. OCSP checking works inconjunction with Certificate Revocation Lists (CRLs)during revocation checking. Below is a summary of the interaction ofOCSP and CRLs. Failover to CRLs occurs only if an OCSP problem isencountered. Failover does not become if the OCSP responder confirmseither that the certificate has been revoked or that it has not beenrevoked.
#2: ObjectId: 1.3.6.1.5.5.7.1.1 Criticality=falseAuthorityInfoAccess [ [accessMethod: 1.3.6.1.5.5.7.48.1 accessLocation: URIName: http://ocsp verisign com,accessMethod: 1.3.6.1.5.5.7.48.2 accessLocation: URIName:http://SVRSecure-aia verisign com/SVRTrial2005-aia cer]]
However the JSSE forge allows specifying a ocsp responderURLproperty. By default the location of the OCSP responder isdetermined implicitly from the certificate being validated. Theproperty is used when the Authority Information Access extension(defined in RFC 3280) is disappear from the certificate or when itrequires overriding. By enabling Certpath Debugging you should see the debugging info asshown below when you set the ocsp enable property to true.
I wouldn't bother with the Euro spec turbo's you won't gain a lot for the hassle. However a hybridised pair of stock turbo's might be worth it. They are the same externally as the stock turbo's but feature larger compressor and turbine wheels.
The 550cc injectors ordain allow you to get close to 550HP with the right turbo's but in reality a small single turbo is required to achieve the power as even the hybrid OEM turbos arn't capable of flowing that much air how to play rouletteroulette how to winroulette tipshow to win at rouletteRun your car on waterRun Car on WaterWater Powered CarWater Carhorse racinghorse racing tipshorse racing bettinghorse racing softwarehorse racing systemsdownloadable moviesdownload beat version moviesdownload moviesmovie downloadsforex trading systemsforex currency tradingforex softwarelearn forexworld of warcraft guidewow gold guidewow guideworld of warcraft cheatshow to play pokerlearn pokerpoker strategypoker sitespoker calculatorfree blackjackonline blackjackblackjack strategyhow to play blackjackiphone downloadsiphone games downloadiphone download site reviewiphone download siteshow to make money on ebaymake money on ebaywarren buffettwarren buffet
Buy world of warcraft goldsBuy WOW golds Cheap WoW GoldWoW PowerlevelingWoW Power levelingCheap WoW Power levelingFinal conceive of XI GilBuy FFXI GilCheap FFXI GilCheap FFXI cater levelingLineage2 AdenaCheap LineageII AdenaBuy Lineage2 AdenaCheap Lineage2 PowerlevelingEverQuest II PlatEverQuest 2 PlatEverQuest 2 GoldEQ2 Gold EQII PlatinumMaple Story MesosBuy Cheap Maple Story MesosMapleStory Power levelingMaple Story cater levelingGuild Wars GoldGuilds Wars Platinum EVE Online ISKEVE ISKBuy EVE Online ISKGaia online GoldGaia GoldBuy Gaia online GoldCheap SilkRoad GoldBuy SilkRoad GoldRunescape GoldCheap Runescape GoldBuy Runescape GoldRunescape cater levelingRunescape PowerlevelingLotro GoldBuy Lotro GoldCheap Lotro GoldBuying Lotro GoldLotro PowerlevelingLotro Power levelingSword Of The New World GoldSword Of The New World VisSword Of The New World Gil
Forex Groups - Tips on Trading
Related article:
http://weblogs.java.net/blog/kumarjayanti/archive/2007/11/ssl_and_crl_che.html
comments | Add comment | Report as Spam
|