SoFunction
Updated on 2025-03-08

Tomcat ssl error Connector attribute SSLCertificateFile must be defined when using SSL with APR solution

Today, my colleague asked for help configuring tomcat ssl, and directly sent him the article configuring tomcat ssl under Linux. Unexpectedly, he actually said that when starting tomcat, he reported the Connector attribute SSLCertificateFile must be defined when using SSL with APR. He ran over and read it immediately. It turned out that his tomcat version was 7.0, and I sent him to tomcat 6, checked the key, and checked the configuration file. Because he copied the configuration of the article I posted for 2-3 hours, he finally solved the problem.

System: windows 7
Environment: tomcat7

1. Generate a key for him first

Copy the codeThe code is as follows:

keytool -genkey -alias tomcat -keyalg RSA

Enter keystore password:  password
Re-enter new password: password
What is your first and last name?
  [Unknown]:  Loiane Groner
What is the name of your organizational unit?
  [Unknown]:  home
What is the name of your organization?
  [Unknown]:  home
What is the name of your City or Locality?
  [Unknown]:  Sao Paulo
What is the name of your State or Province?
  [Unknown]:  SP
What is the two-letter country code for this unit?
  [Unknown]:  BR
Is CN=Loiane Groner, OU=home, O=home, L=Sao Paulo, ST=SP, C=BR correct?
  [no]:  y
 
Enter key password for
    (RETURN if same as keystore password):  password
Re-enter new password: password


Configure SSL

Open the file, they turned out to be

Copy the codeThe code is as follows:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" enableLookups="false"
           acceptCount="100" disableUploadTimeout="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS"
           keystoreFile="Users\loiane/.keystore"
           keystorePass="password" />

Modified to:

Copy the codeThe code is as follows:

<Connector port="8443" protocol=".http11.Http11Protocol" SSLEnabled="true"
           enableLookups="false"
           acceptCount="100" disableUploadTimeout="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS"
           keystoreFile="Users\loiane/.keystore"
           keystorePass="password" />