diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2017-02-11 19:39:56 +0100 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2017-02-11 19:39:56 +0100 |
commit | 9b8b634312f169fab872f3580c2febe5af031615 (patch) | |
tree | 455926d4288682107c0036e68fe26c2934b743cb | |
parent | 3d4a8713edb40f2c1cb2fe480e83793d942c6606 (diff) | |
download | fetchmail-9b8b634312f169fab872f3580c2febe5af031615.tar.gz fetchmail-9b8b634312f169fab872f3580c2febe5af031615.tar.bz2 fetchmail-9b8b634312f169fab872f3580c2febe5af031615.zip |
TLS: set hostname for SNI.
-rw-r--r-- | socket.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1156,6 +1156,20 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck _verify_ok = 1; _prev_err = -1; + /* + * Support SNI, some servers (googlemail) appear to require it. + */ + { + long r; + r = SSL_set_tlsext_host_name(_ssl_context[sock], servercname); + + if (0 == r) { + /* handle error */ + report(stderr, GT_("Warning: SSL_set_tlsext_host_name(%p, \"%s\") failed (code %#lx), trying to continue.\n"), _ssl_context[sock], servercname, r); + ERR_print_errors_fp(stderr); + } + } + if( mycert || mykey ) { /* Ok... He has a certificate file defined, so lets declare it. If |