void-packages/srcpkgs/sylpheed/patches/libsylph_ssl_c.patch
George Matsumura 0ad2a0d153 sylpheed: patch to use SNI
Prior to this patch, sylpheed built against newer versions of LibreSSL could
not connect to IMAP server such as gmail's because it did not use SNI. This
patch from OpenBSD is a simple fix to implement it.

This patch is also necessary with OpenSSL.

Also xlint template.

Closes: #23487 [via git-merge-pr]
2021-01-28 23:37:36 -03:00

20 lines
575 B
Diff

See https://sylpheed.sraoss.jp/redmine/issues/306
Patch is necessary both on LibreSSL and OpenSSL
--- libsylph/ssl.c.orig
+++ libsylph/ssl.c
@@ -258,6 +258,13 @@ gboolean ssl_init_socket_with_method(SockInfo *sockinf
return FALSE;
}
+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
+ if (!SSL_set_tlsext_host_name(sockinfo->ssl, sockinfo->hostname)) {
+ g_warning("Error setting servername extension\n");
+ return FALSE;
+ }
+#endif
+
SSL_set_fd(sockinfo->ssl, sockinfo->sock);
while ((ret = SSL_connect(sockinfo->ssl)) != 1) {
err = SSL_get_error(sockinfo->ssl, ret);