Skip to content

Instantly share code, notes, and snippets.

@spc16670
Last active February 21, 2024 11:58
Show Gist options
  • Save spc16670/8d7bc37af9b555e2663c26fb60f874f9 to your computer and use it in GitHub Desktop.
Save spc16670/8d7bc37af9b555e2663c26fb60f874f9 to your computer and use it in GitHub Desktop.
Download native APR libraties from http://tomcat.apache.org/download-native.cgi
├── ca.crt
├── ca.key
└── tcnative
├── openssl
│   ├── HashInfo.txt
│   ├── libeay32.dll
│   ├── OpenSSL License.txt
│   ├── openssl.exe
│   ├── ReadMe.txt
│   └── ssleay32.dll
├── openssl.exe
├── tcnative-1.dll
├── tcnative-1-src.pdb
└── x64
├── tcnative-1.dll
└── tcnative-1-src.pdb
Generate a self-sigend certificate
openssl genrsa -out ca.key 4096
openssl req -new -x509 -days 1826 -key ca.key -out ca.crt
Comment out Connector and configure accordingly in server.xml
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig honorCipherOrder="false">
<Certificate certificateFile="certs\ca.crt"
certificateKeyFile="certs\ca.key"
type="RSA" />
</SSLHostConfig>
</Connector>
For Tomcat startup create setenv.bat:
set PATH=%PATH;C:\Tomcat\9.0.0.M22\certs\tcnative\x64;C:\Tomcat\9.0.0.M22\certs\openssl
In Eclipse set in Run Configurations:
-Djava.library.path="C:\asdf\tcnative\x64;${env_var:PATH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment