2010-11-25 9 views
8

मैं अपने टॉमकैट में एसएसएल को सक्षम करने की कोशिश कर रहा हूं। लेकिन जब मैं बिलाव शुरू करने और https://localhost:8443 करने के लिए जाना मैं(त्रुटि कोड: ssl_error_rx_record_too_long) टॉमकैट + ओपनएसएसएल

An error occurred during a connection to localhost:8443. 

SSL received a record that exceeded the maximum permissible length. 

(Error code: ssl_error_rx_record_too_long) 

कि मैं CA.sh इस्तेमाल किया निजी कुंजी उत्पन्न करने के लिए और इस तरह के प्रमाण पत्र पर हस्ताक्षर किए ऐसा करने के लिए देखें:

progerlaptop:/usr/share/ssl/misC# ./CA.sh -newca 
CA certificate filename (or enter to create) 

Making CA certificate ... 
Generating a 1024 bit RSA private key 
................................++++++ 
.............................................++++++ 
writing new private key to './demoCA/private/./cakey.pem' 
Enter PEM pass phrase: pass 
Verifying - Enter PEM pass phrase: pass 
----- 
You are about to be asked to enter information that will be incorporated 
into your certificate request. 
What you are about to enter is what is called a Distinguished Name or a DN. 
There are quite a few fields but you can leave some blank 
For some fields there will be a default value, 
If you enter '.', the field will be left blank. 
----- 
Country Name (2 letter code) [AU]:UK 
State or Province Name (full name) [Some-State]:Chernihiv 
Locality Name (eg, city) []:Chernihiv 
Organization Name (eg, company) [Internet Widgits Pty Ltd]:University 
Organizational Unit Name (eg, section) []:student 
Common Name (eg, YOUR name) []:localhost 
Email Address []:[email protected] 

Please enter the following 'extra' attributes 
to be sent with your certificate request 
A challenge password []: 
An optional company name []: 
Using configuration from /etc/ssl/openssl.cnf 
Enter pass phrase for ./demoCA/private/./cakey.pem: 
Check that the request matches the signature 
Signature ok 
Certificate Details: 
     Serial Number: 
      c6:55:7e:58:1b:4d:9c:7e 
     Validity 
      Not Before: Nov 25 13:17:31 2010 GMT 
      Not After : Nov 24 13:17:31 2013 GMT 
     Subject: 
      countryName    = UK 
      stateOrProvinceName  = Chernihiv 
      organizationName   = University 
      organizationalUnitName = student 
      commonName    = localhost 
      emailAddress    = [email protected] 
     X509v3 extensions: 
      X509v3 Subject Key Identifier: 
       C7:98:1E:68:A7:3A:C4:B2:46:C8:88:99:C8:D5:CA:66:D3:94:23:66 
      X509v3 Authority Key Identifier: 
       keyid:C7:98:1E:68:A7:3A:C4:B2:46:C8:88:99:C8:D5:CA:66:D3:94:23:66 

      X509v3 Basic Constraints: 
       CA:TRUE 
Certificate is to be certified until Nov 24 13:17:31 2013 GMT (1095 days) 

Write out database with 1 new entries 
Data Base Updated 
progerlaptop:/usr/share/ssl/misC# ./CA.sh -newreq 
Generating a 1024 bit RSA private key 
............++++++ 
.........................++++++ 
writing new private key to 'newkey.pem' 
Enter PEM pass phrase: pass 
Verifying - Enter PEM pass phrase: pass 
----- 
You are about to be asked to enter information that will be incorporated 
into your certificate request. 
What you are about to enter is what is called a Distinguished Name or a DN. 
There are quite a few fields but you can leave some blank 
For some fields there will be a default value, 
If you enter '.', the field will be left blank. 
----- 
Country Name (2 letter code) [AU]:UK 
State or Province Name (full name) [Some-State]:Chernihiv 
Locality Name (eg, city) []:Chernihiv 
Organization Name (eg, company) [Internet Widgits Pty Ltd]:University 
Organizational Unit Name (eg, section) []:student 
Common Name (eg, YOUR name) []:localhost 
Email Address []:[email protected] 

Please enter the following 'extra' attributes 
to be sent with your certificate request 
A challenge password []: 
An optional company name []: 
Request is in newreq.pem, private key is in newkey.pem 

progerlaptop:/usr/share/ssl/misC# CA.sh -sign 
Using configuration from /etc/ssl/openssl.cnf 
Enter pass phrase for ./demoCA/private/cakey.pem: pass 
... 
Sign the certificate? [y/n]:y 
... 
Signed certificate is in newcert.pem 

कुंजी को कॉपी किया गया और करने के लिए प्रमाणपत्र मेरी टोमकैट निर्देशिका।

cp newcert.pem newkey.pem /path/to/tomcat-6.0.29/ssl/ 

जोड़ा कनेक्टर मेरी server.xml रहे हैं:

<Connector port="8443" maxHttpHeaderSize="8192" 
     maxThreads="150" minSpareThreads="25" maxSpareThreads="75" 
     enableLookups="false" disableUploadTimeout="true" 
     acceptCount="100" scheme="https" secure="true" 
     SSLEngine="on". 
     SSLCertificateFile="${catalina.base}/ssl/newcert.pem" 
     SSLCertificateKeyFile="${catalina.base}/ssl/newkey.pem". 
     SSLPassword="pass"/> 

तब मैं catalina.sh रन शुरू करते हैं। और जब मैं https://localhost:8443/ पर जाता हूं तो मुझे यह ग़लत त्रुटि दिखाई देती है। जब मैं करता हूं तो मैं गलत करता हूं?
अग्रिम

उत्तर

4

टॉमकैट 6 और ऊपर? आपको SSLEnabled = "true" सेट करने की आवश्यकता है, जैसा कि पहले से ही here या here का उत्तर दिया गया है।

0

में धन्यवाद ऐसा लगता है कि अगर आप https के लिए अप्रैल/OpenSSL का उपयोग कर रहे हैं, जिसमें मामले SSLEngine = "पर" सही है।

क्या आपने libtcnative इंस्टॉल किया था?

मान लिया जाये कि बिल्ला 6: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html

त्वरित चरण:

INFO: Loaded APR based Apache Tomcat Native library 1.1.20. 

विकल्प के लिए है:

tar zxf tomcat-native-1.1.20-src.tar.gz 
cd tomcat-native-1.1.20-src/jni/native/ 
./configure --with-apr=/usr/bin/apr-1-config --with-ssl=yes 
make && make install 
cd /usr/java/default/jre/lib/amd64/ 
ln -s /usr/local/apr/lib/libtcnative-1.so 

जब आप बिल्ला शुरू आप अपने catalina.out में इस लाइन को देखने के लिए जेएसएसई का प्रयोग करें और अपने प्रमाणपत्र/कुंजी को जावा कीस्टोर (.keystore फ़ाइल) में जोड़ें। मुझे जावा कीस्टोर को गधे में दर्द का उपयोग करने के लिए लगता है, इसलिए मैं आमतौर पर एपीआर के साथ जाता हूं।

0

मुझे एक ही समस्या थी। मैं कनेक्टर

0

मुझे आशा है कि आप आप मशीन में कुंजीस्टोर फ़ाइल होनी चाहिए करने के लिए protocol="org.apache.coyote.http11.Http11NioProtocol" जोड़कर तय

server.xml फ़ाइल में सुनिश्चित करें और यह भी उल्लेख इस link यह आप

को हल करने के लिए उपयोगी हो सकता है
 <Connector port=”8443” maxHttpHeaderSize=”8192″ 
     maxThreads=”150″ minSpareThreads=”25″ maxSpareThreads=”75″ 
     enableLookups=”false” disableUploadTimeout=”true” 
     acceptCount=”100″ scheme=”https” secure=”true” 
     **keystoreFile=”/../../../Tomcat/mycert.jks”** 
     clientAuth=”false” sslProtocol=”TLS> 
0

मैं पोर्ट मान बदल कर इस समस्या को हल करने में कामयाब रहा। मूल्य 443 आरक्षित था, इसलिए मैंने 1443 डाल दिया, टॉमकैट को पुनरारंभ करें और यह काम किया।

मेरे Connector है:

<Connector port="1443" protocol="HTTP/1.1" SSLEnabled="true" 
      maxThreads="150" scheme="https" secure="true" 
      clientAuth="false" sslProtocol="TLS" keystoreFile="D:/path_to_ca.jks" 
    keystorePass="somePass" /> 

अब यूआरएल है:

https://localhost:1443/index.jsp

चीयर्स!

संबंधित मुद्दे