diff options
author | Damian Minkov <damencho@jitsi.org> | 2010-04-12 09:22:19 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2010-04-12 09:22:19 +0000 |
commit | 825fc5c05fb1c4ab077f58c33a23cd7286f9475c (patch) | |
tree | 6e1be32e8493882f9ca46339c038ab863c8e5e20 /src/net/java/sip/communicator/service/gui | |
parent | 266ac5379503fefae3f211fa900d1005c6187c7e (diff) | |
download | jitsi-825fc5c05fb1c4ab077f58c33a23cd7286f9475c.zip jitsi-825fc5c05fb1c4ab077f58c33a23cd7286f9475c.tar.gz jitsi-825fc5c05fb1c4ab077f58c33a23cd7286f9475c.tar.bz2 |
- Fix saving certificates, there was a problem when on startup more than one certificates need save.
- Fix closing chatroom window on disconnected provider.
Diffstat (limited to 'src/net/java/sip/communicator/service/gui')
-rw-r--r-- | src/net/java/sip/communicator/service/gui/CertificateVerificationService.java | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/service/gui/CertificateVerificationService.java b/src/net/java/sip/communicator/service/gui/CertificateVerificationService.java index 41ee2ac..c76626d 100644 --- a/src/net/java/sip/communicator/service/gui/CertificateVerificationService.java +++ b/src/net/java/sip/communicator/service/gui/CertificateVerificationService.java @@ -6,7 +6,10 @@ */ package net.java.sip.communicator.service.gui; +import java.io.*; +import java.security.*; import java.security.cert.*; +import javax.net.ssl.*; /** * A service which implementors will ask the user for permission for the @@ -40,7 +43,7 @@ public interface CertificateVerificationService /** * Checks does the user trust the supplied chain of certificates, when - * connecting to the server and port. + * connecting to the server and port. If needed shows dialog to confirm. * * @param chain the chain of the certificates to check with user. * @param toHost the host we are connecting. @@ -48,5 +51,32 @@ public interface CertificateVerificationService * @return the result of user interaction on of DO_NOT_TRUST, TRUST_ALWAYS, * TRUST_THIS_SESSION_ONLY. */ - int verificationNeeded(Certificate[] chain, String toHost, int toPort); + public int verify(X509Certificate[] chain, String toHost, int toPort); + + /** + * Obtain custom trust manager, which will try verify the certificate and + * if verification fails will query the user for acceptance. + * + * @param toHost the host we are connecting. + * @param toPort the port used when connecting. + * @return the custom trust manager. + * @throws GeneralSecurityException when there is problem creating + * the trust manager + */ + public X509TrustManager getTrustManager(String toHost, int toPort) + throws GeneralSecurityException; + + /** + * Returns SSLContext instance initialized with the custom trust manager, + * which will try verify the certificate and if verification fails + * will query the user for acceptance. + * + * @param toHost the host we are connecting. + * @param toPort the port used when connecting. + * @return the SSLContext + * @throws IOException throws exception when unable to initialize the + * ssl context. + */ + public SSLContext getSSLContext(String toHost, int toPort) + throws IOException; } |