v2-0001-libsylph-ssl.c-Support-SNI-some-servers-imap.gmai.patch 1019 B

1234567891011121314151617181920212223242526272829303132
  1. From b554d88ca0032051a19f57dce8dcda298173e6cd Mon Sep 17 00:00:00 2001
  2. From: Antonio Ospite <ao2@ao2.it>
  3. Date: Fri, 24 Aug 2018 10:46:04 +0200
  4. Subject: [PATCH v2] libsylph/ssl.c: Support SNI, some servers (imap.gmail.com)
  5. seem to require it
  6. X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb;]yA5<GWI5`6u&+
  7. ;6b'@y|8w"wB;4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG
  8. !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE
  9. ---
  10. libsylph/ssl.c | 4 ++++
  11. 1 file changed, 4 insertions(+)
  12. diff --git a/libsylph/ssl.c b/libsylph/ssl.c
  13. index 61e770f8..b4f6be0c 100644
  14. --- a/libsylph/ssl.c
  15. +++ b/libsylph/ssl.c
  16. @@ -262,6 +262,10 @@ gboolean ssl_init_socket_with_method(SockInfo *sockinfo, SSLMethod method)
  17. return FALSE;
  18. }
  19. +#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
  20. + SSL_set_tlsext_host_name(sockinfo->ssl, sockinfo->hostname);
  21. +#endif
  22. +
  23. SSL_set_fd(sockinfo->ssl, sockinfo->sock);
  24. while ((ret = SSL_connect(sockinfo->ssl)) != 1) {
  25. err = SSL_get_error(sockinfo->ssl, ret);
  26. --
  27. 2.19.0.rc2