Gemalto GemEngine support
To set up the Gemalto GemEngine within nevisProxy, you have to proceed in a similar way as if you would set up Apache with a Gemalto engine.
The next steps (with a sample configuration) show how to proceed. For more information, see also the Gemalto documentation Apache HTTP Server, Document Number: 007-011228-001, Rev. H.
This setup was tested with the HSM model "SafeNet Luna SA 1700 (generation 5)", the OpenSSL engine GemEngine version 1.4, the library "Cryptoki" version 6.3.0 and the program "sautil" version 2.0.0. Other versions of these tools should be compatible. For integration support with your GemEngine, consult your Thales/Gemalto contact.
General configuration
Copy the libgem.so (this is the GemEngine library, provided by Gemalto) to the openssl-engines directory (usually /usr/lib64/openssl/engines).
Adapt the /etc/Chrystoki.conf using the OptimizeApache.sh script provided by Gemalto. Something like the following sample script will be added:
Misc = {
Apache = 0;
}
GemEngine = {
LibPath = /usr/safenet/lunaclient/lib/libCryptoki2.so;
LibPath64 = /usr/safenet/lunaclient/lib/libCryptoki2_64.so;
EngineInit = 0:10:11;
DisableRand = 1;
DisableDsa = 1;
DisableEcdsa = 1;
DisableCheckFinalize = 0;
EnableRsaGenKeyPair = 1;
EnableDsaGenKeyPair = 0;
EnablePkeyMeths = 0;
IntermediateProcesses = 0;
}Check that DisableCheckFinalize and IntermediateProcesses are set to 0, add these lines if necessary. The other settings may vary depending on your HSM configuration.
Open a session to SafeNet Luna HSM using the sautil provided by Gemalto:
sautil -v -s 0 -i 10:11 -o -q
Generate a private key:
sautil -v -s 0 -i 10:11 -g 2048 -f /var/opt/nevisproxy/<instance>/certs/gemKey.pem
Generate a certificate:
OPENSSL_ENGINES=/usr/lib64/openssl/engines openssl req -engine gem -new -nodes -key
/var/opt/nevisproxy/<instance>/certs/gemKey.pem -out
/var/opt/nevisproxy/<instance>/certs/gemCert.req -days 1000 -verify
OPENSSL_ENGINES=/usr/lib64/openssl/engines openssl x509 -engine gem -req -days 1000 -in
/var/opt/nevisproxy/<instance>/certs/gemCert.req -signkey
/var/opt/nevisproxy/<instance>/certs/gemKey.pem -out
/var/opt/nevisproxy/<instance>/certs/gemCert.pemSpecify the following settings in the navajo.xml file:
- In the
<SSL>
section:
SSLCertificateFile="/var/opt/nevisproxy/<instance>/certs/gemCert.pem"
SSLCertificateKeyFile="/var/opt/nevisproxy/<instance>/certs/gemKey.pem"- In the
<Server>
section:
SSLCryptoDevice="gem"
- In the
In env.conf file you have to set:
OPENSSL_ENGINES=/usr/lib64/openssl/engines
export OPENSSL_ENGINESRestart nevisProxy after you have made the previously described changes.
Gemalto GemEngine support for the HttpsConnectorServlet
To set up the Gemalto Engine for SSL-key verification on the HttpsConnectorServlet, proceed as follows:
Generate a private key:
sautil -v -s 0 -i 10:11 -g 2048 -f /var/opt/nevisproxy/<instance>/certs/gemClientKey.pem
Sign the key with the CA of the backend. For example:
cd /var/opt/nevisproxy/<instance>/certs
OPENSSL_ENGINES=/usr/lib64/openssl/engines openssl req -engine gem -new -key gemClientKey.pem -out gemClient_req.pem
OPENSSL_ENGINES=/usr/lib64/openssl/engines openssl ca -engine gem -days 365 -keyfile <yourCaKey>.pem -cert <yourCaCert>.pem -outdir . -in gemClient_req.pem -out gemClientCert.pem::
Set the signed certificate and key as the SSLClientCertificateFile and SSLClientKeyFileof the HttpsConnectorServlet:
<servlet>
<servlet-name>HttpsConnectorServlet</servlet-name>
<servlet-class>ch::nevis::isiweb4::servlet::connector::http::HttpsConnectorServlet</servlet-class>
<init-param>
<param-name>InetAddress</param-name>
<param-value><backendHost>:<backendPort></param-value>
</init-param>
<init-param>
<param-name>SSLClientCertificateFile</param-name>
<param-value>/var/opt/nevisproxy/<instance>/certs/gemClientCert.pem</param-value>
</init-param>
<init-param>
<param-name>SSLClientKeyFile</param-name>
<param-value>/var/opt/nevisproxy/<instance>/certs/gemClientKey.pem</param-value>
</init-param>
<init-param>
<param-name>SSLCACertificateFile</param-name>
<param-value><yourCaCert>.pem</param-value>
</init-param>
</servlet>Set the following bc-property in the bc.property file:
bc.net.ssl.SSLCryptoDevice=gem
In env.conf,specify the following setting:
OPENSSL_ENGINES=/usr/lib64/openssl/engines
export OPENSSL_ENGINESRestart nevisProxy after you have made the previously described changes.
Depending on the engine, other HttpsConnectorServlets may no longer work correctly, if they use certificates that are not created by the engine itself.