您现在的位置是:网站首页 > 情感障碍

转的果然是5分钟配成TOMCAT使用SSL(https)

本站2019-08-1336人围观
简介 June30,2011|ByThistutorialwillwalkyouthroughhowtoconfigureSSL(https://localhost:8443access):(use

	转的果然是5分钟配成TOMCAT使用SSL(https)

June30,2011|ByThistutorialwillwalkyouthroughhowtoconfigureSSL(https://localhost:8443access):(usedversion6forthistutorial)(usedversion7forthistutorial)Thesetupconsistsin3basicsteps:CreateakeystorefileusingJavaConfigureTomcattousethekeystoreTestit(Bonus)ConfigureyourapptoworkwithSSL(accessthroughhttps://localhost:8443/yourApp)1CreatingaKeystorefileusingJavaFisrt,opentheterminalonyourcomputerandtype:Windows:cd%JAVA_HOME%/binLinuxorMacOS:cd$JAVA_HOME/binThe$JAVA_HOMEonMacislocatedon/System/Library/Frameworks//Versions/{yourjavaversion}/Home/Youwillchang,,typeontheterminal:keytool-genkey-aliastomcat-keyalgRSAWhenyoutypethecommandabove,,itwillaskyoutocreateapassword(Mypasswordispassword):loiane:binloiane$keytool-genkey-aliastomcat-keyalgRSAEnterkeystorepassword:passwordRe-enternewpassword:passwordWhatisyourfirstandlastname[Unknown]:LoianeGronerWhatisthenameofyourorganizationalunit[Unknown]:homeWhatisthenameofyourorganization[Unknown]:homeWhatisthenameofyourCityorLocality[Unknown]:SaoPauloWhatisthenameofyourStateorProvince[Unknown]:SPWhatisthetwo-lettercountrycodeforthisunit[Unknown]:BRIsCN=LoianeGroner,OU=home,O=home,L=SaoPaulo,ST=SP,C=BRcorrect[no]:yesEnterkeypasswordfor(RETURNifsameaskeystorepassword):passwordRe-enternewpassword:,itwillbeon:C:\DocumentsandSettings\[username];onMacitwillbeon/Users/[username]andonLinuxwillbeon/home/[username].2ConfiguringTomcatforusingthekeystorefileS,:!--Connectorport="8443"protocol="HTTP/"SSLEnabled="true"maxThreads="150"scheme="https"secure="true"clientAuth="false"sslProtocol="TLS"/--Uncommentitandmodifyittolooklikethefollowing:ConnectorSSLEnabled="true"acceptCount="100"clientAuth="false"disableUploadTimeout="true"enableLookups="false"maxThreads="25"port="8443"keystoreFile="/Users/loiane/.keystore"keystorePass="password"protocol=""scheme="https"secure="true"sslProtocol="TLS"/NoteweaddthekeystoreFile,!:4BONUS-ConfiguringyourapptoworkwithSSL(accessthroughhttps://localhost:8443/yourApp)ToforceyourwebapplicationtoworkwithSSL,(beforeweb-apptagends):security-constraintweb-resource-collectionweb-resource-namesecuredapp/web-resource-nameurl-pattern/*/url-pattern/web-resource-collectionuser-data-constrainttransport-guaranteeCONFIDENTIAL/transport-guarantee/user-data-constraint/security-constraintTheurlpatternissetto/*soanypage/resourcefromyourapplicationissecure(itcanbeonlyaccessedwithhttps).Thetranspor,,:(thistutorialisalittleconfusing,thatiswhyIdecidedtowriteanotheronemyown).HappyCoding!有兴趣可以访问下我的生活博客:postedon2012-11-1223:17阅读(2953)所属分类:。