You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Flokmane <fl...@iratensolutions.com> on 2007/01/12 15:30:34 UTC
how to set my TrustManager[] in webdav
Hi,
Is it possible to replace
"System.setProperty("javax.net.ssl.trustStore", truststore_name)" by
setting my trustManagers[] in webdav?
I have the certificate of the server and I want to use the following
code to create my trustManagers[] :
-----------------------------------------------------------------------
private TrustManager[] createMyTrustManagers(X509Certificate
certificate) {
TrustManager[] trustManagers = null;
KeyStore trustStore = KeyStore.getInstance("JKS");
trustStore.load(null, null);
trustStore.setCertificateEntry("server", certificate);
if (trustStore != null) {
TrustManagerFactory trustManagerFactory =
TrustManagerFactory.getInstance("JKS", "SunJSSE");
trustManagerFactory.init(trustStore);
trustManagers = trustManagerFactory.getTrustManagers();
}
......
return trustManagers;
}
Thanks in advance,
Fatiha.
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org