# HG changeset patch
# Node ID 88cd100802c2
# Parent  c8555ca0fe5e
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -405,6 +405,7 @@
 		* purple_connection_new_unregister
 		* purple_connection_destroy
 		* purple_connection_set_account
+		* purple_connection_ssl_error
 		* PurpleConnectionUiOps->connect_progress
 		* purple_connection_update_progress
 		* purple_connections_get_connecting
@@ -666,6 +667,7 @@
 		* purple_srv_cancel
 		* purple_srv_resolve_account
 		* purple_srv_txt_query_destroy
+		* PurpleSslErrorType
 		* purple_str_add_cr
 		* purple_strcasereplace
 		* PurpleStunNatType
diff --git a/libpurple/connection.h b/libpurple/connection.h
--- a/libpurple/connection.h
+++ b/libpurple/connection.h
@@ -195,21 +195,6 @@
 	char *description;
 };
 
-/**
- * PurpleSslErrorType:
- * @PURPLE_SSL_HANDSHAKE_FAILED: The handshake failed
- * @PURPLE_SSL_CONNECT_FAILED: The connection failed
- * @PURPLE_SSL_CERTIFICATE_INVALID: The certificated is invalid
- *
- * Possible SSL errors.
- */
-typedef enum
-{
-	PURPLE_SSL_HANDSHAKE_FAILED = 1,
-	PURPLE_SSL_CONNECT_FAILED = 2,
-	PURPLE_SSL_CERTIFICATE_INVALID = 3
-} PurpleSslErrorType;
-
 #include <time.h>
 
 #include "account.h"
@@ -496,19 +481,6 @@
 PurpleConnectionErrorInfo *
 purple_connection_get_error_info(PurpleConnection *gc);
 
-/**
- * purple_connection_ssl_error:
- * @gc: The connection.
- * @ssl_error: The SSL error type.
- *
- * Closes a connection due to an SSL error; this is basically a shortcut to
- * turning the #PurpleSslErrorType into a #PurpleConnectionError and a
- * human-readable string and then calling purple_connection_error().
- */
-void
-purple_connection_ssl_error (PurpleConnection *gc,
-                             PurpleSslErrorType ssl_error);
-
 /*
  * purple_connection_g_error
  * @gc: Connection the error is associated with
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -426,36 +426,6 @@
 }
 
 void
-purple_connection_ssl_error(PurpleConnection *gc,
-                            PurpleSslErrorType ssl_error)
-{
-	PurpleConnectionError reason;
-	const gchar *message;
-
-	switch (ssl_error) {
-		case PURPLE_SSL_HANDSHAKE_FAILED:
-			message = _("SSL Handshake Failed");
-			reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
-			break;
-		case PURPLE_SSL_CONNECT_FAILED:
-			message = _("SSL Connection Failed");
-			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
-			break;
-		case PURPLE_SSL_CERTIFICATE_INVALID:
-			/* TODO: maybe PURPLE_SSL_* should be more specific? */
-			message = _("SSL peer presented an invalid certificate");
-			reason = PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR;
-			break;
-		default:
-			g_assert_not_reached ();
-			message = _("Unknown SSL error");
-			reason = PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR;
-	}
-
-	purple_connection_error(gc, reason, message);
-}
-
-void
 purple_connection_g_error(PurpleConnection *pc, const GError *error) {
 	PurpleConnectionError reason;
 
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -731,10 +731,14 @@
 			/* Connection already closed/freed. Escape. */
 		} else if (g_error_matches(error, G_TLS_ERROR, G_TLS_ERROR_HANDSHAKE)) {
 			/* In Gio, a handshake error is because of the cert */
-			purple_connection_ssl_error(js->gc, PURPLE_SSL_CERTIFICATE_INVALID);
+			purple_connection_error(js->gc,
+			                        PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR,
+			                        _("SSL peer presented an invalid certificate"));
 		} else {
 			/* Report any other errors as handshake failing */
-			purple_connection_ssl_error(js->gc, PURPLE_SSL_HANDSHAKE_FAILED);
+			purple_connection_error(js->gc,
+			                        PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
+			                        _("SSL Handshake Failed"));
 		}
 
 		g_error_free(error);
@@ -770,7 +774,8 @@
 		                     "Error creating TLS client connection: %s",
 		                     error->message);
 		g_clear_error(&error);
-		purple_connection_ssl_error(js->gc, PURPLE_SSL_CONNECT_FAILED);
+		purple_connection_error(js->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+		                        _("SSL Connection Failed"));
 		return;
 	}
 
