title: Error installing pyopenssl using pip
body: <p>I am trying to install different packages using python pip, but i get this error:</p>
  
  <blockquote>
    <p>File
    "/usr/local/lib/python2.7/site-packages/pip-8.1.2-py2.7.egg/pip/_vendor/
        cnx.set_tlsext_host_name(server_hostname) AttributeError: '_socketobject' object has no attribute 'set_tlsext_host_name'</p>
  </blockquote>
  
  <p>I some workaroundI founr I need to install <a href="https://stackoverflow.com/questions/31576258/attributeerror-socketobject-object-has-no-attribute-set-tlsext-host-name">pyoepnssl</a>.</p>
  
  <p>When I try to manually install pyopenssl I get the error:</p>
  
  <blockquote>
    <p>gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
    -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c OpenSSL/ssl/connection.c -o
    build/temp.linux-x86_64-2.7/OpenSSL/ssl/connection.o
    OpenSSL/ssl/connection.c: In function âssl_Connection_set_contextâ:
    OpenSSL/ssl/connection.c:289: warning: implicit declaration of
    function âSSL_set_SSL_CTXâ OpenSSL/ssl/connection.c: In function
    âssl_Connection_get_servernameâ: OpenSSL/ssl/connection.c:313: error:
    âTLSEXT_NAMETYPE_host_nameâ undeclared (first use in this function)
    OpenSSL/ssl/connection.c:313: error: (Each undeclared identifier is
    reported only once OpenSSL/ssl/connection.c:313: error: for each
    function it appears in.) OpenSSL/ssl/connection.c:320: warning:
    implicit declaration of function âSSL_get_servernameâ
    OpenSSL/ssl/connection.c:320: warning: assignment makes pointer from
    integer without a cast OpenSSL/ssl/connection.c: In function
    âssl_Connection_set_tlsext_host_nameâ: OpenSSL/ssl/connection.c:346:
    warning: implicit declaration of function âSSL_set_tlsext_host_nameâ
    error: command 'gcc' failed with exit status 1</p>
  </blockquote>
  
  <p>I already have installed all the libraries gcc, python-devel, gcc-c++, libffi-devel, openssl-devel. I am using Red Hat 4</p>
  
  <p>I don't know if I am missing some library.</p>
  
  <p>Any advice.</p>
  
  <p>Thanks in advance</p>