public static StringBuffer getServerCertificatePrompt(X509Certificate cert, String realm, String hostName) { return getServerCertificatePrompt(cert, realm, hostName, EnumSet.noneOf(SVNCertificateFailureKind.class)); }
public int acceptServerAuthentication(SVNURL url, String realm, Object serverAuth, boolean resultMayBeStored) { if (serverAuth != null && myPrompt instanceof PromptUserPassword2) { PromptUserPassword2 sslPrompt = (PromptUserPassword2) myPrompt; serverAuth = serverAuth instanceof X509Certificate ? SVNSSLUtil.getServerCertificatePrompt((X509Certificate) serverAuth, realm, url.getHost()) : serverAuth; if (serverAuth == null) { serverAuth = "Unsupported certificate type '" + (serverAuth != null ? serverAuth.getClass().getName() : "null") + "'"; } return sslPrompt.askTrustSSLServer(serverAuth.toString(), resultMayBeStored); } return ACCEPTED; }
public int acceptServerAuthentication(SVNURL url, String realm, Object serverAuth, boolean resultMayBeStored) { if (myPrompt instanceof PromptUserPassword2 && serverAuth instanceof X509Certificate) { PromptUserPassword2 sslPrompt = (PromptUserPassword2) myPrompt; serverAuth = serverAuth instanceof X509Certificate ? SVNSSLUtil.getServerCertificatePrompt((X509Certificate) serverAuth, realm, url.getHost()) : serverAuth; if (serverAuth == null) { serverAuth = "Unsupported certificate type '" + (serverAuth != null ? serverAuth.getClass().getName() : "null") + "'"; } return sslPrompt.askTrustSSLServer(serverAuth.toString(), resultMayBeStored); } else if (myPrompt != null && serverAuth instanceof byte[]) { String prompt = "The ''{0}'' server''s key fingerprint is:\n{1}\n" + "If you trust this host, select ''Yes'' to add the key to the SVN cache and carry on connecting.\n" + "If you do not trust this host, select ''No'' to abandon the connection."; if (!myPrompt.askYesNo(realm, prompt, false)) { return REJECTED; } } return ACCEPTED; }
public int acceptServerAuthentication(SVNURL url, String realm, Object serverAuth, boolean resultMayBeStored) { if (myPrompt instanceof PromptUserPassword2 && serverAuth instanceof X509Certificate) { PromptUserPassword2 sslPrompt = (PromptUserPassword2) myPrompt; serverAuth = serverAuth instanceof X509Certificate ? SVNSSLUtil.getServerCertificatePrompt((X509Certificate) serverAuth, realm, url.getHost()) : serverAuth; if (serverAuth == null) { serverAuth = "Unsupported certificate type '" + (serverAuth != null ? serverAuth.getClass().getName() : "null") + "'"; } return sslPrompt.askTrustSSLServer(serverAuth.toString(), resultMayBeStored); } else if (myPrompt != null && serverAuth instanceof byte[]) { String prompt = "The ''{0}'' server''s key fingerprint is:\n{1}\n" + "If you trust this host, select ''Yes'' to add the key to the SVN cache and carry on connecting.\n" + "If you do not trust this host, select ''No'' to abandon the connection."; prompt = MessageFormat.format(prompt, new Object[] {url.getHost(), SVNSSLUtil.getFingerprint((byte[]) serverAuth, "MD5")}); if (!myPrompt.askYesNo(realm, prompt, false)) { return REJECTED; } } return ACCEPTED; }
public int acceptServerAuthentication(SVNURL url, String realm, Object serverAuth, boolean resultMayBeStored) { if (serverAuth instanceof X509Certificate) { serverAuth = serverAuth instanceof X509Certificate ? SVNSSLUtil.getServerCertificatePrompt((X509Certificate) serverAuth, realm, url.getHost()) : serverAuth; if (serverAuth == null) { serverAuth = "Unsupported certificate type '" + (serverAuth != null ? serverAuth.getClass().getName() : "null") + "'"; } return prompt.askTrustSSLServer(serverAuth.toString(), resultMayBeStored); } else if (prompt != null && serverAuth instanceof byte[]) { String prompt = "The ''{0}'' server''s key fingerprint is:\n{1}\n" + "If you trust this host, select ''Yes'' to add the key to the SVN cache and carry on connecting.\n" + "If you do not trust this host, select ''No'' to abandon the connection."; prompt = MessageFormat.format(prompt, new Object[]{url.getHost(), SVNSSLUtil.getFingerprint((byte[]) serverAuth, "MD5")}); if (!this.prompt.askYesNo(realm, prompt, false)) { return REJECTED; } } return ACCEPTED; }
StringBuffer prompt = SVNSSLUtil.getServerCertificatePrompt(cert, realm, hostName, trustServerCertificateFailureKinds); if (resultMayBeStored) { prompt.append("\n(R)eject, accept (t)emporarily or accept (p)ermanently? ");
StringBuffer prompt = SVNSSLUtil.getServerCertificatePrompt(cert, realm, hostName, trustServerCertificateFailureKinds); if (resultMayBeStored) { prompt.append("\n(R)eject, accept (t)emporarily or accept (p)ermanently? ");