You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bhuvanesh Pattanashetti <bh...@gmail.com> on 2010/03/03 15:05:57 UTC

Problem setting keyAlias for https connector using tomcat 6.0 API's

Hello All,

I m using tomcat
connector<http://tomcat.apache.org/tomcat-6.0-doc/api/index.html>API's
to establish a connector (on some port both http & https) at run time.


I have no issues with the Http as of now.

But Https, facing one issue.



The connector specified on port is getting established successfully.

I do it as following.



connector.setPort(7005);

connector.setProperty("keystoreFile", "C:/myKeyStore.jks");

connector.setProperty("keystorePass", "keypassword");

And some more properties.



When there is more than one certificate in the keystore, I want it to pick
particular certificate specified by alias.

But when i set *connector.setProperty ("keyAlias", "mykey");*

It’s not picking the certificate with specified alias, rather picking some
random certificate.



I tried with <Connector port="7005" keystoreFile="pathToKeyStore"
keystorePass="keypassword" keyAlias="mykey" />

This works very much fine.



Can you please suggest me how to set keyAlias for connector using connector
API's.


Please let me know if more information is needed.

Looking for your replies

Thanks,

Bhuvan