(Fehlercode: ssl_error_rx_record_too_long) Tomcat+OpenSSL
Ich versuche zum aktivieren von SSL in meiner Tomcat.
Aber wenn ich starten Sie Tomcat und gehen Sie zu https://localhost:8443 ich sehe
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)
Zu tun, dass ich verwendet CA.sh generieren Sie einen privaten Schlüssel und signiertes Zertifikat wie folgt aus:
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 []:proger@localhost
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 = proger@localhost
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 []:proger@localhost
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
Kopiert key und cert in meinem Tomcat Verzeichnis.
cp newcert.pem newkey.pem /path/to/tomcat-6.0.29/ssl/
Hinzugefügt Stecker an meinem 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"/>
Dann starte ich catalina.sh laufen.
Und wenn ich gehe, https://localhost:8443/ sehe ich diese fiesen Fehler.
Wenn ich mache ich falsch?
Vielen Dank im Voraus
Du musst angemeldet sein, um einen Kommentar abzugeben.
Tomcat 6 und oben? Sie müssen die SSLEnabled="true"), als bereits beantwortet hier oder hier.
Wie es aussieht, bist du mit APR/OpenSSL für https in dem Fall SSLEngine="an" ist richtig.
Haben Sie libtcnative?
Vorausgesetzt, tomcat 6: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
Schnelle Schritte:
Beim starten von tomcat haben Sie, um zu sehen, diese Zeile in deiner catalina.aus:
Die alternative ist die Verwendung von JSSE und fügen Sie Ihre Zertifikate/Schlüssel in eine java-keystore - (.keystore-Datei). Ich finde den java-keystore, ein Schmerz in den Arsch zu verwenden, so gehe ich gewöhnlich mit APR.
Ich hatte das gleiche Problem. Ich habe es behoben durch hinzufügen
protocol="org.apache.coyote.http11.Http11NioProtocol"
um den AnschlussIch hoffe, Sie haben sollte die keystore-Datei in Ihrer Maschine
Stellen Sie sicher, in der server.xml Datei und Lesen Sie auch diese link, könnte es hilfreich sein, für Sie zu lösen
Habe ich es geschafft, dieses problem zu lösen, indem Sie ein Anschluss - Wert. Der Wert 443 vorbehalten war, so stellte ich 1443 starten Sie Tomcat neu, und es funktionierte.
Meine
Connector
ist:Nun die URL ist:
https://localhost:1443/index.jsp
Prost!