> ## Content Index
> Fetch the complete content index at: https://www.bagz.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# openssl/pyOpenSSL - "SSL23_GET_SERVER_HELLO:tlsv1 alert internal error"
- URL: https://www.bagz.fr/opensslpyopenssl-ssl23_get_server_hellotlsv1-alert-internal-error/
- Published: 2016-06-09T09:57:45.000Z
- Updated: 2016-06-09T09:57:45.000Z
- Author: bgazui
- Tags: Linux, Python, #Migrated-1790668826633, #wp, #wp-post, #Import 2026-09-29 08:00

You're getting this annoying error message again and again when trying to fetch certificate and/or establish a connection to your website using openssl:139647967614624:error:14077438:SSL routines:SSL23\_GET\_SERVER\_HELLO:tlsv1 alert internal error:s23\_clnt.c:769:  

This issue is well known in several openssl versions, and a bug has been addressed for Ubuntu repositories:  
<https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1475228>

For now, there's a simple workaround that works to quickly fix it!

### For openssl

If you're facing it while using openssl directly, you can fix it by specifying the *servername* on command-line:openssl s\_client -connect www.mywebsite.com:443 -servername www.mywebsite.com  

### For pyOpenSSL

If you're having this issue while using pyOpenSSL (python wrapper for OpenSSL), it can also be fixed with a quick workaround by adding the option *set\_tlsext\_host\_name()* to specify the server name in your "Connection" object. You will get something like this:import socket  
from OpenSSL import SSL  

# REPLACE WITH YOUR OWN WEBSITE

hostname = 'www.mywebsite.com'  
  
ctx = SSL.Context(SSL.TLSv1\_METHOD)  
  
sock = socket.socket()  
  
ssl\_sock = SSL.Connection(ctx, sock)  
  
ssl\_sock.set\_tlsext\_host\_name(hostname)  
  
ssl\_sock.connect((hostname, 443))  
  
ssl\_sock.do\_handshake()  
  
cert = ssl\_sock.get\_peer\_certificate()  
  
print cert.get\_subject().commonName