An application that only includes openssl/ssl.h from OpenSSL
1.0.0 and doesn't use winsock.h will run into problems on Windows,
since the dtls1.h header file includes the winsock.h header file long
after the ossl_typ.h header file was loaded.

The latter includes a couple of #undefs needed to work around symbol
naming collisions, the most important one being "#undef X509_NAME".

As a result, compiling the application fails with strange errors, e.g.

openssl\src\crypto\x509name.h(28) : error C2059: syntax error : '('
openssl\src\crypto\x509name.h(31) : error C2059: syntax error : '}'
openssl-win32\vc9\inc32\openssl/x509v3.h(192) : error C2059: syntax error : '('
openssl-win32\vc9\inc32\openssl/x509v3.h(200) : error C2059: syntax error : 
'type'
openssl-win32\vc9\inc32\openssl/x509v3.h(204) : error C2059: syntax error : '}'
openssl-win32\vc9\inc32\openssl/x509v3.h(205) : error C2059: syntax error : '}'
openssl-win32\vc9\inc32\openssl/x509v3.h(211) : error C2061: syntax error : 
identifier 'GENERAL_NAME'

I'm not sure what the right fix would be. Since the dtls1.h header
file is included unconditionally in ssl.h, perhaps moving the winsock.h
import into ossl_typ.h might be a solution. The #undefs would then work
as intended again.

For the application in question (pyOpenSSL, an OpenSSL Python extension),
the work-around is to #include <winsock.h> prior to including
openssl/ssl.h, so that the #undefs can take effect.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 26 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to