Giter VIP home page Giter VIP logo

nassl's Introduction

nassl

Build Wheels PyPI version PyPI wheel PyPI version

Experimental OpenSSL wrapper for Python 3.8+ and SSLyze.

Do NOT use for anything serious. This code has not been properly tested/reviewed and is not production ready.

Quick Start

Nassl can be installed directly via pip:

pip install nassl

Development environment

To setup a development environment:

$ pip install --upgrade pip setuptools wheel
$ pip install -r requirements-dev.txt

Nassl relies on a C extension to call into OpenSSL; you can compile everything using:

$ invoke build.all

Then, the tests can be run using:

$ invoke test

Project structure

nassl/

Classes implemented in Python are part of the nassl namespace; they are designed to provide a simpler, higher-level interface to perform SSL connections.

nassl/_nassl/

Classes implemented in C are part of the nassl._nassl namespace; they try to stay as close as possible to OpenSSL's API. In most cases, Python methods of such objects directly match the OpenSSL function with same name. For example the _nassl.SSL.read() Python method matches OpenSSL's SSL_read() function.

These classes should be considered internal.

Why another SSL library?

I'm the author of SSLyze, an SSL scanner written in Python. Scanning SSL servers requires access to low-level SSL functions within the OpenSSL API, for example to test for things like insecure renegotiation or session resumption.

None of the existing OpenSSL wrappers for Python (including ssl, M2Crypto and pyOpenSSL) expose the APIs that I need for SSLyze, so I had to write my own wrapper.

License

See ./LICENSE.txt

Please contact me if this license doesn't work for you.

Author

Alban Diquet - @nabla_c0d3 - https://nabla-c0d3.github.io

nassl's People

Contributors

aequitas avatar bcyrill avatar bluec0re avatar c0r0n3r avatar codyd51 avatar dependabot[bot] avatar droptableuser avatar dtrodrigues avatar duongkai avatar elvanderb avatar fabian-hk avatar fwinterborn avatar fwinterbornbb avatar fxcoudert avatar jsf9k avatar kyprizel avatar makinj avatar moyaldror avatar mrcage avatar nabla-c0d3 avatar protocall7 avatar ralphdolmans avatar schinkelg avatar singingwolfboy avatar stefanb avatar tuxlife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nassl's Issues

the latest releases does not include bin/*.a files and broken

I have tried to re-download few last releases 14.x 15.x and found that all bin/**/lib*.a files are broken.
They are just small text files with a content similar to the following:

version https://git-lfs.github.com/spec/v1
oid sha256:9a6d8ac805a54e10b153028eab00a320241da224011ec36281966640245620b1
size 4851612

nassl not in PyPI

nassl no longer appears to be in PyPI. Is this intended? I noticed that the version was updated recently.

$ pip search nassl
$ 

Python3 compatibility

If I've to start a new project with nassl, I'll start it with python 3. Have you planned a port ?

do not download sources if a directory already exist

I'm packaging this tool to pentoo and need to compile it in a sandbox env.
We do not allow tools to download or install anything on its own so I have to download openssl/zlib tools in advance and place them into "deps" directory.

However, the current build_tasks script does not validate that and downloads it even if it is already exists.

Please do not overwrite it or make fetching function optional

Typo mismatch in README.md

In README.md there is a typo - instead of pipenv shell it says pivenv shell

$ cd nassl
$ pipenv install --dev
$ pivenv shell

Build problems with very recent Python and OpenSSL

With very recent software (gcc 9, python 3.8) I'm getting a build failure:

building 'nassl._nassl_legacy' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=native -mtune=native -O3 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -DLEGACY_OPENSSL=1 -I./nassl/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.8 -c nassl/_nassl/nassl.c -o build/temp.linux-x86_64-3.8/nassl/_nassl/nassl.o -Wall
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=native -mtune=native -O3 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -DLEGACY_OPENSSL=1 -I./nassl/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.8 -c nassl/_nassl/nassl_SSL_CTX.c -o build/temp.linux-x86_64-3.8/nassl/_nassl/nassl_SSL_CTX.o -Wall
nassl/_nassl/nassl_SSL_CTX.c: In function 'nassl_SSL_CTX_new':
nassl/_nassl/nassl_SSL_CTX.c:61:25: warning: implicit declaration of function 'SSLv2_method'; did you mean 'SSLv23_method'? [-Wimplicit-function-declaration]
   61 |    sslCtx = SSL_CTX_new(SSLv2_method());
      |                         ^~~~~~~~~~~~
      |                         SSLv23_method
nassl/_nassl/nassl_SSL_CTX.c:61:25: warning: passing argument 1 of 'SSL_CTX_new' makes pointer from integer without a cast [-Wint-conversion]
   61 |    sslCtx = SSL_CTX_new(SSLv2_method());
      |                         ^~~~~~~~~~~~~~
      |                         |
      |                         int
In file included from nassl/_nassl/nassl_SSL_CTX.c:4:
/usr/include/openssl/ssl.h:1503:17: note: expected 'const SSL_METHOD *' {aka 'const struct ssl_method_st *'} but argument is of type 'int'
 1503 | __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
      |                 ^~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c:70:25: warning: implicit declaration of function 'SSLv3_method'; did you mean 'SSLv23_method'? [-Wimplicit-function-declaration]
   70 |    sslCtx = SSL_CTX_new(SSLv3_method());
      |                         ^~~~~~~~~~~~
      |                         SSLv23_method
nassl/_nassl/nassl_SSL_CTX.c:70:25: warning: passing argument 1 of 'SSL_CTX_new' makes pointer from integer without a cast [-Wint-conversion]
   70 |    sslCtx = SSL_CTX_new(SSLv3_method());
      |                         ^~~~~~~~~~~~~~
      |                         |
      |                         int
In file included from nassl/_nassl/nassl_SSL_CTX.c:4:
/usr/include/openssl/ssl.h:1503:17: note: expected 'const SSL_METHOD *' {aka 'const struct ssl_method_st *'} but argument is of type 'int'
 1503 | __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
      |                 ^~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c:78:4: warning: 'TLSv1_method' is deprecated [-Wdeprecated-declarations]
   78 |    sslCtx = SSL_CTX_new(TLSv1_method());
      |    ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:15,
                 from nassl/_nassl/nassl_SSL_CTX.c:4:
/usr/include/openssl/ssl.h:1877:1: note: declared here
 1877 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /* TLSv1.0 */
      | ^~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c:81:4: warning: 'TLSv1_1_method' is deprecated [-Wdeprecated-declarations]
   81 |    sslCtx = SSL_CTX_new(TLSv1_1_method());
      |    ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:15,
                 from nassl/_nassl/nassl_SSL_CTX.c:4:
/usr/include/openssl/ssl.h:1883:1: note: declared here
 1883 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(void)) /* TLSv1.1 */
      | ^~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c:84:4: warning: 'TLSv1_2_method' is deprecated [-Wdeprecated-declarations]
   84 |    sslCtx = SSL_CTX_new(TLSv1_2_method());
      |    ^~~~~~
In file included from /usr/include/openssl/e_os2.h:13,
                 from /usr/include/openssl/ssl.h:15,
                 from nassl/_nassl/nassl_SSL_CTX.c:4:
/usr/include/openssl/ssl.h:1889:1: note: declared here
 1889 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */
      | ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:494,
                 from /usr/include/python3.8/Python.h:30,
                 from nassl/_nassl/nassl_SSL_CTX.c:2:
In function 'strncpy',
    inlined from 'pem_passwd_cb' at nassl/_nassl/nassl_SSL_CTX.c:260:5,
    inlined from 'pem_passwd_cb' at nassl/_nassl/nassl_SSL_CTX.c:238:12:
/usr/include/bits/string_fortified.h:106:10: warning: '__builtin_strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c: In function 'pem_passwd_cb':
nassl/_nassl/nassl_SSL_CTX.c:253:20: note: length computed here
  253 |     passwordSize = strlen(passwordBuf) + 1;
      |                    ^~~~~~~~~~~~~~~~~~~
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=native -mtune=native -O3 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -DLEGACY_OPENSSL=1 -I./nassl/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.8 -c nassl/_nassl/nassl_SSL.c -o build/temp.linux-x86_64-3.8/nassl/_nassl/nassl_SSL.o -Wall
nassl/_nassl/nassl_SSL.c: In function 'nassl_SSL_get_available_compression_methods':
nassl/_nassl/nassl_SSL.c:323:53: error: dereferencing pointer to incomplete type 'SSL_COMP' {aka 'const struct ssl_comp_st'}
  323 |         methodPyString = PyUnicode_FromString(method->name);
      |                                                     ^~
nassl/_nassl/nassl_SSL.c: In function 'get_tmp_new_cipher':
nassl/_nassl/nassl_SSL.c:462:39: error: dereferencing pointer to incomplete type 'SSL' {aka 'struct ssl_st'}
  462 |     if (self->ssl == NULL || self->ssl->s3 == NULL)
      |                                       ^~
nassl/_nassl/nassl_SSL.c: In function 'nassl_SSL_get_dh_info':
nassl/_nassl/nassl_SSL.c:837:21: error: dereferencing pointer to incomplete type 'EVP_PKEY' {aka 'struct evp_pkey_st'}
  837 |         DH *dh = key->pkey.dh;
      |                     ^~
nassl/_nassl/nassl_SSL.c:838:15: error: dereferencing pointer to incomplete type 'DH' {aka 'struct dh_st'}
  838 |         p = dh->p;
      |               ^~
nassl/_nassl/nassl_SSL.c: In function 'get_tmp_new_cipher':
nassl/_nassl/nassl_SSL.c:470:1: warning: control reaches end of non-void function [-Wreturn-type]
  470 | }
      | ^
error: command 'gcc' failed with exit status 1

Rock64 aarm64 build fails

Hi there,

I am trying to build the 1.1.3 version from scratch on Debian 9. I keep getting the same error. Whatever version I get the same error. I could successfully build

https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
https://github.com/PeterMosmans/openssl/blob/1.0.2-chacha

By following the https://github.com/PeterMosmans/openssl/blob/1.0.2-chacha/INSTALL guide.

But when building the 1.1.3 version of sassl I keep getting the below error:

nassl-1.1.3# aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-T7HGOX/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-T7HGOX/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-aarch64-2.7/nassl/_nassl/nassl.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL_CTX.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_errors.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_BIO.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509_EXTENSION.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL_SESSION.o build/temp.linux-aarch64-2.7/nassl/_nassl/openssl_utils.o build/temp.linux-aarch64-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o build/temp.linux-aarch64-2.7/nassl/_nassl/python_utils.o bin/openssl-legacy/linux64/libssl.a bin/openssl-legacy/linux64/libcrypto.a bin/zlib/linux64/libz.a -o build/lib.linux-aarch64-2.7/nassl/_nassl_legacy.so -Wl,-z,noexecstack
/usr/bin/ld:bin/openssl-legacy/linux64/libssl.a: file format not recognized; treating as linker script
/usr/bin/ld:bin/openssl-legacy/linux64/libssl.a:1: syntax error

ocsp_response_tests.py intermittent failure

During CI for sslyze 1.1.2, the ocsp_response_tests.py failed on 2 of 3 nodes with the error

ERROR: test (ocsp_response_tests.OcspResponseOnlineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/private/tmp/sslyze--nassl-20170723-33396-165b37s/nassl-0.16.3/tests/ocsp_response_tests.py", line 35, in test
    self.assertIsNotNone(ocsp_response.as_text())
AttributeError: 'NoneType' object has no attribute 'as_text'

Using https://github.com/nabla-c0d3/nassl/archive/0.16.3.tar.gz.

See https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/5135/version=sierra/console

Support for dynamic linking of OpenSSL

First of all, thanks for your great work!

I'm currently working on bringing SSLyze into Nix. As Nassl is a dependency of SSLyze, I also had to create a package for it first. In the review of the PR, the question came up, if there's any way to dynamically link Nassl against the system OpenSSL version, at least for the modern OpenSSL suite.

Thanks!

Nassl 3.0.0 compatibility with Python3.8?

Hi

Is Nassl compatible with python 3.8? Im having this error

ImportError: dlopen(/Users/javi/Library/Python/3.8/lib/python/site-packages/nassl/_nassl.cpython-38-darwin.so, 2): Symbol not found: ____chkstk_darwin
Referenced from: /Users/javi/Library/Python/3.8/lib/python/site-packages/nassl/_nassl.cpython-38-darwin.so
Expected in: /usr/lib/libSystem.B.dylib
in /Users/javi/Library/Python/3.8/lib/python/site-packages/nassl/_nassl.cpython-38-darwin.so

Thanks

nassl / sslyze PKGBUILD

Dear nable,

I'm trying to fix the sslyze PKGBUILD for ArchLinux, which curently doesn't build successfully.

For this I can't rely on pipenv, so an installation using classic setup.py would be helpful.

Add support for TLS 1.3 early data

Can we add early data support?
It can be useful also in sslyze to test servers support and maybe vunrabilities to reply or DoS attacks.

I dont mind to take it.
Thanks

nassl 4.0 will not install or build on M1 Mac

Hi Alban,

Running Big Sur 11.2.1 with Python 3.9.2 and I'm not able to install or build nassl. I think the issue is that there is no wheel for M1 Macs based on the below?

  _Skipping link: none of the wheel's tags match: cp39-cp39-macosx_10_9_x86_64
  Skipping link: none of the wheel's tags match: cp39-cp39-manylinux2010_i686
  Skipping link: none of the wheel's tags match: cp39-cp39-manylinux2010_x86_64
  Skipping link: none of the wheel's tags match: cp39-cp39-win_amd64_

The full verbose output is attached if you need it.
pip_verbose.txt

So I tried to build it from source, both the legacy and modern ssl fail to compile. Both give a "usage error" similar to the following:

Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]

In both cases, its followed up with asking me to pick a compiler (followed by a long list). I can provide more detail as necessary but troubleshooting issues like this on my end alone is over my head. Happy to help debug.

Unclosed sockets

While using nassl (via sslyze) inside of a Docker container, I saw this go by:

/opt/pyenv/versions/3.6.1-debug/lib/python3.6/site-packages/nassl/ssl_client.py:132: ResourceWarning: unclosed <socket.socket fd=89, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('XX.XX.XX.XX', 45828), raddr=('XX.XX.XX.XX', 443)>

The relevant line is here: https://github.com/nabla-c0d3/nassl/blob/master/nassl/ssl_client.py#L132

May not be a big deal at all, but I figured I'd at least document it here, in case it points to something worth cleaning up.

Can't build C extension

I'm running python 3.6.4 on Arch Linux, and I can't build the C extension:

 $ git clone [email protected]:nabla-c0d3/nassl.git
Cloning into 'nassl'...
remote: Counting objects: 2770, done.
remote: Compressing objects: 100% (107/107), done.
remote: Total 2770 (delta 39), reused 99 (delta 15), pack-reused 2643
Receiving objects: 100% (2770/2770), 2.31 MiB | 293.00 KiB/s, done.
Resolving deltas: 100% (1739/1739), done.
$ cd nassl/
$ pyenv version
3.6.4 (set by /home/jeremy_frasier/nassl/.python-version)
$ pip install -r requirements.txt
Ignoring typing: markers 'python_version < "3.5"' don't match your environment
Ignoring enum34: markers 'python_version < "3.4"' don't match your environment
$ python setup.py build_ext -i
running build_ext
building 'nassl._nassl_legacy' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/nassl
creating build/temp.linux-x86_64-3.6/nassl/_nassl
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/home/jeremy_frasier/.pyenv/versions/3.6.4/include/python3.6m -c nassl/_nassl/nassl.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o -Wall
<snip>
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/home/jeremy_frasier/.pyenv/versions/3.6.4/include/python3.6m -c nassl/_nassl/python_utils.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o -Wall
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/nassl
gcc -pthread -shared -L/home/jeremy_frasier/.pyenv/versions/3.6.4/lib -L/home/jeremy_frasier/.pyenv/versions/3.6.4/lib build/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_EXTENSION.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_NAME_ENTRY.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o build/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o build/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o bin/openssl-legacy/linux64/libssl.a bin/openssl-legacy/linux64/libcrypto.a bin/zlib/linux64/libz.a -o build/lib.linux-x86_64-3.6/nassl/_nassl_legacy.cpython-36m-x86_64-linux-gnu.so -Wl,-z,noexecstack
/bin/ld:bin/openssl-legacy/linux64/libssl.a: file format not recognized; treating as linker script
/bin/ld:bin/openssl-legacy/linux64/libssl.a:1: syntax error
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

I have this issue on Arch, Alpine, and even in a Ubuntu 16.04 Docker image. Could something be wrong with the version of bin/openssl-legacy/linux64/libssl.a in the repository? I also noticed this, which may indicate the problem:

$ file /usr/lib/libz.a
/usr/lib/libz.a: current ar archive
$ file bin/openssl-legacy/linux64/libssl.a 
bin/openssl-legacy/linux64/libssl.a: ASCII text

Installation error nassl v1.0.1 on Windows 7

Python 2:

python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
building 'nassl._nassl_legacy' extension
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl.obj
nassl.c
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl_SSL_CTX.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl_SSL_CTX.obj
nassl_SSL_CTX.c
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl_SSL.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl_SSL.obj
nassl_SSL.c
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl_X509.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl_X509.obj
nassl_X509.c
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl_errors.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl_errors.obj
nassl_errors.c
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl_BIO.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl_BIO.obj
nassl_BIO.c
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python27\include -IC:\Python27\PC /Tcnassl/_nassl/nassl_X509_EXTENSION.c /Fobuild\temp.win32-2.7\Release\nassl/_nassl/nassl_X509_EXTENSION.obj
nassl_X509_EXTENSION.c
nassl/_nassl/nassl_X509_EXTENSION.c(67) : error C2275: 'PyObject' : illegal use of this type as an expression
        c:\python27\include\object.h(108) : see declaration of 'PyObject'
nassl/_nassl/nassl_X509_EXTENSION.c(67) : error C2065: 'result' : undeclared identifier
nassl/_nassl/nassl_X509_EXTENSION.c(69) : error C2065: 'result' : undeclared identifier
nassl/_nassl/nassl_X509_EXTENSION.c(69) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
error: command 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

Python 3:

python3 setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
building 'nassl._nassl_legacy' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl.obj
nassl.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_SSL_CTX.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_SSL_CTX.obj
nassl_SSL_CTX.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_SSL.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_SSL.obj
nassl_SSL.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_X509.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_X509.obj
nassl_X509.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_errors.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_errors.obj
nassl_errors.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_BIO.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_BIO.obj
nassl_BIO.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_X509_EXTENSION.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_X509_EXTENSION.obj
nassl_X509_EXTENSION.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_X509_NAME_ENTRY.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_X509_NAME_ENTRY.obj
nassl_X509_NAME_ENTRY.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_SSL_SESSION.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_SSL_SESSION.obj
nassl_SSL_SESSION.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/openssl_utils.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/openssl_utils.obj
openssl_utils.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/nassl_OCSP_RESPONSE.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_OCSP_RESPONSE.obj
nassl_OCSP_RESPONSE.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLEGACY_OPENSSL=1 -Ibin\openssl-legacy\include -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcnassl/_nassl/python_utils.c /Fobuild\temp.win-amd64-3.5\Release\nassl/_nassl/python_utils.obj
python_utils.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Python35\libs /LIBPATH:C:\Python35\libs /LIBPATH:C:\Python35\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" user32.lib kernel32.lib Gdi32.lib Advapi32.lib Ws2_32.lib crypt32.lib /EXPORT:PyInit__nassl_legacy build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_SSL_CTX.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_SSL.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_X509.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_errors.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_BIO.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_X509_EXTENSION.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_X509_NAME_ENTRY.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_SSL_SESSION.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/openssl_utils.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/nassl_OCSP_RESPONSE.obj build\temp.win-amd64-3.5\Release\nassl/_nassl/python_utils.obj bin\zlib\win64\zlibstat.lib bin\openssl-legacy\win64\libeay32.lib bin\openssl-legacy\win64\ssleay32.lib /OUT:build\lib.win-amd64-3.5\nassl\_nassl_legacy.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\nassl/_nassl\_nassl_legacy.cp35-win_amd64.lib
bin\zlib\win64\zlibstat.lib : fatal error LNK1107: ะฝะตะดะพะฟัƒัั‚ะธะผั‹ะน ะธะปะธ ะฟะพะฒั€ะตะถะดะตะฝะฝั‹ะน ั„ะฐะนะป: ะฝะต ัƒะดะฐะตั‚ัั ะฟั€ะพั‡ะธั‚ะฐั‚ัŒ ะฟะพ 0x83
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1107

Installing the old version (nassl-0.17.0) without errors.
Any ideas how to install the new version?

Alpine Linux: libssl.a: file format not recognized; treating as linker script

Following on from #30 when trying to build nassl 1.1.0 on Alpine Linux I get the following error:

# sudo pip3 install --upgrade https://github.com/nabla-c0d3/nassl/archive/1.1.0.tar.gz
Collecting https://github.com/nabla-c0d3/nassl/archive/1.1.0.tar.gz
  Downloading https://github.com/nabla-c0d3/nassl/archive/1.1.0.tar.gz (2.0MB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 2.0MB 381kB/s
Installing collected packages: nassl
  Found existing installation: nassl 0.17.0
    Uninstalling nassl-0.17.0:
      Successfully uninstalled nassl-0.17.0
  Running setup.py install for nassl ... error
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-q2k5aflw-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-vs155ft9-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/nassl
    copying nassl/__init__.py -> build/lib.linux-x86_64-3.6/nassl
    copying nassl/ssl_client.py -> build/lib.linux-x86_64-3.6/nassl
    copying nassl/legacy_ssl_client.py -> build/lib.linux-x86_64-3.6/nassl
    copying nassl/ocsp_response.py -> build/lib.linux-x86_64-3.6/nassl
    running build_ext
    building 'nassl._nassl_legacy' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/nassl
    creating build/temp.linux-x86_64-3.6/nassl/_nassl
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL_CTX.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_X509.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_errors.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_BIO.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_X509_EXTENSION.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_EXTENSION.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_X509_NAME_ENTRY.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_NAME_ENTRY.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL_SESSION.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/openssl_utils.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_OCSP_RESPONSE.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o -Wall
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-q2k5aflw-build/bin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/python_utils.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o -Wall
    gcc -shared -Wl,--as-needed -Wl,--as-needed build/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_EXTENSION.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_NAME_ENTRY.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o build/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o build/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o /tmp/pip-q2k5aflw-build/bin/openssl-legacy/linux64/libssl.a /tmp/pip-q2k5aflw-build/bin/openssl-legacy/linux64/libcrypto.a /tmp/pip-q2k5aflw-build/bin/zlib/linux64/libz.a -L/usr/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/nassl/_nassl_legacy.cpython-36m-x86_64-linux-gnu.so -Wl,-z,noexecstack
    /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld:/tmp/pip-q2k5aflw-build/bin/openssl-legacy/linux64/libssl.a: file format not recognized; treating as linker script
    /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld:/tmp/pip-q2k5aflw-build/bin/openssl-legacy/linux64/libssl.a:1: syntax error
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of nassl
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-q2k5aflw-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-vs155ft9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-q2k5aflw-build/

As a side-note pip is unable to get 1.1.0 from pypi because nassl-1.1.0.tar.gz is not available from https://pypi.python.org/simple/nassl/, so I had to provide the URL to github instead.

nassl 3.0.0 does not appear to be compatible with Python 3.9

Doing a pip install nassl using Python 3.9 appears to try to install nassl 1.0.3 instead of 3.0.0.

Trying to install nassl 3.0.0 with: pip install nassl==3.0.0
results in this:
ERROR: Could not find a version that satisfies the requirement nassl==3.0.0 (from versions: 0.13.4.win32, 0.13.1, 0.13.2, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.17.0, 1.0.1, 1.0.2, 1.0.3)
ERROR: No matching distribution found for nassl==3.0.0

Even though pip search nassl returns this:
nassl (3.0.0) - Experimental OpenSSL wrapper for Python 3.7+ and SSLyze.

Interesting that the very old nassl 1.0.3 seems to install fine, but nothing newer. Is there a reason for that?

FYI, installing nassl 3.0.0 on Python 3.8.6 works just fine.

Thanks

Disable executable stack

sslyze does not work on Windows WSL (tested on Ubuntu 16.04.3 LTS, installed via pip) because nassl is compiled with executable stack.

I think executable stack is not necessary for nassl to work properly, because if I disable it, then sslyze seemingly works correctly. On the other hand enabling executable stack imposes a security risk.

The related WSL issue: microsoft/WSL#2866

Turning executable stack off (for testing purposes):

sslyze ... => exception
sudo apt install execstack
sudo execstack -c /usr/local/lib/python2.7/dist-packages/nassl/_nassl.so
sudo execstack -c /usr/local/lib/python2.7/dist-packages/nassl/_nassl_legacy.so
sslyze ... => works

A related cryptography package issue (pyca/cryptography#3993) links to an openssl issue (openssl/openssl#4575) where they say that

all the linux distros work around this by providing the -Wa,--noexecstack incantation, but people who compile their own OpenSSL do not get these protections.

So it may resolve the issue if you add -Wa,--noexecstack to the appropriate configure script.

You can check whether the library is compiled with executable stack or not like this:

Compiled without executable stack (expected / good state):

$ execstack _nassl.so
- _nassl.so

Compiled with executable stack (current / bad state):

$ execstack _nassl.so
X _nassl.so

fails to compile with -j4 threads

python3.6 setup.py build -j 4
running build
running build_py
file nassl/key_exchange_info.py (for module nassl.key_exchange_info) not found
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/__init__.py -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/ssl_client.py -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/legacy_ssl_client.py -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/ocsp_response.py -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/cert_chain_verifier.py -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/ephemeral_key_info.py -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
copying nassl/py.typed -> /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl
file nassl/key_exchange_info.py (for module nassl.key_exchange_info) not found
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building 'nassl._nassl_legacy' extension
building 'nassl._nassl' extension
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl
creating /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL_CTX.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL_CTX.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o -Wall
In file included from /usr/include/string.h:495,
                 from /usr/include/python3.6m/Python.h:30,
                 from nassl/_nassl/nassl_SSL_CTX.c:2:
In function โ€˜strncpyโ€™,
    inlined from โ€˜pem_passwd_cbโ€™ at nassl/_nassl/nassl_SSL_CTX.c:258:5,
    inlined from โ€˜pem_passwd_cbโ€™ at nassl/_nassl/nassl_SSL_CTX.c:236:12:
/usr/include/bits/string_fortified.h:106:10: warning: โ€˜__builtin_strncpyโ€™ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c: In function โ€˜pem_passwd_cbโ€™:
nassl/_nassl/nassl_SSL_CTX.c:251:20: note: length computed here
  251 |     passwordSize = strlen(passwordBuf) + 1;
      |                    ^~~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c: In function โ€˜nassl_SSL_CTX_newโ€™:
nassl/_nassl/nassl_SSL_CTX.c:78:4: warning: โ€˜TLSv1_methodโ€™ is deprecated [-Wdeprecated-declarations]
   78 |    sslCtx = SSL_CTX_new(TLSv1_method());
      |    ^~~~~~
In file included from /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/e_os2.h:13,
                 from /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:15,
                 from nassl/_nassl/nassl_SSL_CTX.c:4:
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:1852:45: note: declared here
 1852 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /* TLSv1.0 */
      |                                             ^~~~~~~~~~~~
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/opensslconf.h:109:37: note: in definition of macro โ€˜DECLARE_DEPRECATEDโ€™
  109 | #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
      |                                     ^
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:1852:1: note: in expansion of macro โ€˜DEPRECATEDIN_1_1_0โ€™
 1852 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void)) /* TLSv1.0 */
      | ^~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c:81:4: warning: โ€˜TLSv1_1_methodโ€™ is deprecated [-Wdeprecated-declarations]
   81 |    sslCtx = SSL_CTX_new(TLSv1_1_method());
      |    ^~~~~~
In file included from /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/e_os2.h:13,
                 from /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:15,
                 from nassl/_nassl/nassl_SSL_CTX.c:4:
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:1858:45: note: declared here
 1858 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(void)) /* TLSv1.1 */
      |                                             ^~~~~~~~~~~~~~
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/opensslconf.h:109:37: note: in definition of macro โ€˜DECLARE_DEPRECATEDโ€™
  109 | #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
      |                                     ^
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:1858:1: note: in expansion of macro โ€˜DEPRECATEDIN_1_1_0โ€™
 1858 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(void)) /* TLSv1.1 */
      | ^~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c:84:4: warning: โ€˜TLSv1_2_methodโ€™ is deprecated [-Wdeprecated-declarations]
   84 |    sslCtx = SSL_CTX_new(TLSv1_2_method());
      |    ^~~~~~
In file included from /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/e_os2.h:13,
                 from /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:15,
                 from nassl/_nassl/nassl_SSL_CTX.c:4:
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:1864:45: note: declared here
 1864 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */
      |                                             ^~~~~~~~~~~~~~
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/opensslconf.h:109:37: note: in definition of macro โ€˜DECLARE_DEPRECATEDโ€™
  109 | #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
      |                                     ^
/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include/openssl/ssl.h:1864:1: note: in expansion of macro โ€˜DEPRECATEDIN_1_1_0โ€™
 1864 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(void)) /* TLSv1.2 */
      | ^~~~~~~~~~~~~~~~~~
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o -Wall
In file included from /usr/include/string.h:495,
                 from /usr/include/python3.6m/Python.h:30,
                 from nassl/_nassl/nassl_SSL_CTX.c:2:
In function โ€˜strncpyโ€™,
    inlined from โ€˜pem_passwd_cbโ€™ at nassl/_nassl/nassl_SSL_CTX.c:258:5,
    inlined from โ€˜pem_passwd_cbโ€™ at nassl/_nassl/nassl_SSL_CTX.c:236:12:
/usr/include/bits/string_fortified.h:106:10: warning: โ€˜__builtin_strncpyโ€™ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nassl/_nassl/nassl_SSL_CTX.c: In function โ€˜pem_passwd_cbโ€™:
nassl/_nassl/nassl_SSL_CTX.c:251:20: note: length computed here
  251 |     passwordSize = strlen(passwordBuf) + 1;
      |                    ^~~~~~~~~~~~~~~~~~~
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_X509.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_X509.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_errors.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_errors.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_BIO.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_BIO.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL_SESSION.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_SSL_SESSION.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/openssl_utils.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_OCSP_RESPONSE.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/openssl_utils.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -DLEGACY_OPENSSL=1 -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/python_utils.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_OCSP_RESPONSE.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -L. -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -march=native -O2 -pipe -frecord-gcc-switches /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/libssl.a /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_0_2e/libcrypto.a /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/zlib-1.2.11/libz.a -L/usr/lib64 -lpython3.6m -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl/_nassl_legacy.cpython-36m-x86_64-linux-gnu.so -Wl,-z,noexecstack
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o: file not recognized: file truncated
collect2: error: ld returned 1 exit status
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/python_utils.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -march=native -O2 -pipe -frecord-gcc-switches -fPIC -I/var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl_X509_STORE_CTX.c -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_STORE_CTX.o -Wall
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -L. -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -march=native -O2 -pipe -frecord-gcc-switches /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_STORE_CTX.o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/libssl.a /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/openssl-OpenSSL_1_1_1/libcrypto.a /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0/deps/zlib-1.2.11/libz.a -L/usr/lib64 -lpython3.6m -o /var/tmp/portage/dev-python/nassl-3.0.0-r1/work/nassl-3.0.0-python3_6/lib/nassl/_nassl.cpython-36m-x86_64-linux-gnu.so -Wl,-z,noexecstack
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1

TLS Ticket

Is it possible to get the TLS session ticket lifetime hint through nassl?
The openssl session information do contain the lifetime hint:

SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    [...]
    TLS session ticket lifetime hint: 129600 (seconds)
    TLS session ticket:
[...]

Calling ssl_connection.ssl_client.get_session().as_text() does not return this value:

SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: [...]
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1507290277
    Timeout   : 7200 (sec)
    Verify return code: 20 (unable to get local issuer certificate)

"This repository is over its data quota. Purchase more data packs to restore access."

Hi,
I am unable to clone or pull from Github because of a git-lfs quota.

When I clone:

$ git clone https://github.com/nabla-c0d3/nassl.git .
Cloning into '.'...
remote: Counting objects: 2015, done.
remote: Total 2015 (delta 0), reused 0 (delta 0), pack-reused 2015
Receiving objects: 100% (2015/2015), 800.11 KiB | 1.52 MiB/s, done.
Resolving deltas: 100% (1289/1289), done.
Downloading bin/openssl/darwin64/libcrypto.a (3.51 MB)
Error downloading object: bin/openssl/darwin64/libcrypto.a (cad2581e8c52d078d7e156393a1c78e664c54dd2d9ada76233f806619b7381c8)

Errors logged to /Users/andrew/Development/nassl/.git/lfs/objects/logs/20170723T094525.490493612.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs smudge -- %f' failed 2
error: external filter 'git-lfs smudge -- %f' failed
fatal: bin/openssl/darwin64/libcrypto.a: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

The log file reads:

git-lfs/1.4.4 (GitHub; darwin amd64; go 1.7.1)
git version 2.11.0

$ git-lfs smudge -- bin/openssl/darwin64/libcrypto.a
Error downloading object: bin/openssl/darwin64/libcrypto.a (cad2581e8c52d078d7e156393a1c78e664c54dd2d9ada76233f806619b7381c8)

Smudge error: Error downloading cad2581e8c52d078d7e156393a1c78e664c54dd2d9ada76233f806619b7381c8: batch response: http: This repository is over its data quota. Purchase more data packs to restore access.
Docs: https://help.github.com/articles/purchasing-additional-storage-and-bandwidth-for-a-personal-account/: batch response: http: This repository is over its data quota. Purchase more data packs to restore access.
Docs: https://help.github.com/articles/purchasing-additional-storage-and-bandwidth-for-a-personal-account/
[Rest Omitted]

The link: https://help.github.com/articles/purchasing-additional-storage-and-bandwidth-for-a-personal-account/

Surprisingly, the same git-lfs assets are used across public repositories, which means that our fork at jambonsw/nassl is also unavailable, and that we have been using your bandwidth. I was unaware of this but feel partly responsible, and would be happy to pay for one git-lfs pack for the next two months ($5 for two months).

Can't build from scratch

I've been seeing a few segfaults when running 30k-40k sslyze scans with the new 1.4+ versions of sslyze. As a result I was trying to build nassl from scratch so I can attach with a debugger and figure out what is going on. This is with a debug build of python 3.6.4 on an up-to-date installation of Arch.

Unfortunately I can't get nassl to build from scratch. When I do this:

git clone --branch bugfix/use_env_to_find_python https://github.com/jsf9k/nassl.git
cd nassl
pip install -r requirements.txt
wget http://zlib.net/zlib-1.2.11.tar.gz
tar xvfz  zlib-1.2.11.tar.gz
wget https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2e.tar.gz
tar xvfz openssl-1.0.2e.tar.gz
git clone https://github.com/openssl/openssl.git ./openssl-master
python build_from_scratch.py

I get some failed tests:

======================================================================
ERROR: test_write_early_data_doesnot_finish_handshake (tests.ssl_client_tests.ModernSslClientOnlineEarlyDataTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jeremy_frasier/18F/domain-scan/nassl/tests/ssl_client_tests.py", line 233, in test_write_early_data_doesnot_finish_handshake
    self.ssl_client.do_handshake()
  File "/home/jeremy_frasier/18F/domain-scan/nassl/nassl/ssl_client.py", line 180, in do_handshake
    self._ssl.do_handshake()
nassl._nassl.OpenSSLError: error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version


======================================================================
ERROR: test_write_early_data_fail_when_trying_to_send_more_than_max_ealry_data (tests.ssl_client_tests.ModernSslClientOnlineEarlyDataTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jeremy_frasier/18F/domain-scan/nassl/tests/ssl_client_tests.py", line 251, in test_write_early_data_fail_when_trying_to_send_more_than_max_ealry_data
    self.ssl_client.do_handshake()
  File "/home/jeremy_frasier/18F/domain-scan/nassl/nassl/ssl_client.py", line 180, in do_handshake
    self._ssl.do_handshake()
nassl._nassl.OpenSSLError: error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version


======================================================================
FAIL: test_set_cipher_list_bad (tests.SSL_tests.Modern_SSL_Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jeremy_frasier/18F/domain-scan/nassl/tests/SSL_tests.py", line 94, in test_set_cipher_list_bad
    self.assertRaises(_nassl.OpenSSLError, test_ssl.set_cipher_list, 'badcipherstring')
AssertionError: OpenSSLError not raised by set_cipher_list

----------------------------------------------------------------------
Ran 140 tests in 9.873s

FAILED (failures=1, errors=2, skipped=11)
Test failed: <unittest.runner.TextTestResult run=140 errors=2 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=140 errors=2 failures=1>
Traceback (most recent call last):
  File "./build_from_scratch.py", line 294, in <module>
    main()
  File "./build_from_scratch.py", line 288, in main
    perform_build_task('NASSL Tests', NASSL_TEST_TASKS)
  File "./build_from_scratch.py", line 197, in perform_build_task
    subprocess.check_call(command, shell=True, cwd=cwd)
  File "/home/jeremy_frasier/.pyenv/versions/3.6.4-debug/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/home/jeremy_frasier/18F/domain-scan/venv/bin/python setup.py test' returned non-zero exit status 1.

Any thoughts on why these tests would be failing? When I try to use the tls1.3-draft-18 or tls1.3-draft-19 branches of openssl/openssl I don't even get this far.

Can't install 3.0.0

Im running py 3.7

$ pip --version
pip 18.1 from /home/myoung/.asdf/installs/python/3.7.2/lib/python3.7/site-packages/pip (python 3.7)

Pypi shows a valid 3.0.0 with the only req being py>=3.7, however:

$ pip install nassl==3.0.0
Collecting nassl==3.0.0
  Could not find a version that satisfies the requirement nassl==3.0.0 (from versions: 0.13.4.win32, 0.13.1, 0.13.2, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.17.0, 1.0.1, 1.0.2, 1.0.3, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0)
No matching distribution found for nassl==3.0.0
You are using pip version 18.1, however version 20.1b1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Get curve information

Is it possible to get the ECDH server params using nassl? Especially information about the curve?
I tried DebugSslClient.get_ecdh_param but this doesn't contain the curve.
image

Client certificate doesn't work because of mixing up datatypes in function

The function _use_private_key awaits the whole client_key_type but gets only the value.

Fix:

diff --git a/nassl/ssl_client.py b/nassl/ssl_client.py
index cc67690..a8f83fd 100755
--- a/nassl/ssl_client.py
+++ b/nassl/ssl_client.py
@@ -324,7 +324,7 @@ class SslClient(object):
         # type: () -> int
         return self._ssl.get_cipher_bits()
 
-    def _use_private_key(self, client_certchain_file, client_key_file, client_key_type, client_key_password):
+    def _use_private_key(self, client_certchain_file, client_key_file, client_key_type_value, client_key_password):
         # type: (Text, Text, OpenSslFileTypeEnum, Text) -> None
         """The certificate chain file must be in PEM format. Private method because it should be set via the
         constructor.
@@ -338,7 +338,7 @@ class SslClient(object):
         self._ssl_ctx.use_certificate_chain_file(client_certchain_file)
         self._ssl_ctx.set_private_key_password(client_key_password)
         try:
-            self._ssl_ctx.use_PrivateKey_file(client_key_file, client_key_type.value)
+            self._ssl_ctx.use_PrivateKey_file(client_key_file, client_key_type_value)
         except OpenSSLError as e:
             if 'bad password read' in str(e) or 'bad decrypt' in str(e):
                 raise ValueError('Invalid Private Key')

Compatibility with Python 3.6.8

I use CentOS 7.9 and got interested in updating the version of this lib I get using pip. Which is 2.2.0:

$ pip3 install --user nassl
Collecting nassl
  Using cached https://files.pythonhosted.org/packages/1c/59/2aa9ab432a09e0814231b52cd2dd030d7b308d7288ffcc8493a2bdb957db/nassl-2.2.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: nassl
Successfully installed nassl-2.2.0

If I uninistall that default version + clone this repo and check out a commit by tag 2.2.0:

$ git branch
* (detached from 2.2.0)
  release

... then it starts building it and fails:

$ pip3 install --user .
Processing /home/admin2/nassl
Installing collected packages: nassl
  Running setup.py install for nassl ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-8zmtyiqd-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zagcipu2-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    /home/admin2/.local/lib/python3.6/site-packages/setuptools/dist.py:645: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions.
Please use the underscore name 'description_file' instead
      % (opt, underscore_opt))
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/nassl
    copying nassl/__init__.py -> build/lib.linux-x86_64-3.6/nassl
    copying nassl/ssl_client.py -> build/lib.linux-x86_64-3.6/nassl
    copying nassl/legacy_ssl_client.py -> build/lib.linux-x86_64-3.6/nassl
    copying nassl/ocsp_response.py -> build/lib.linux-x86_64-3.6/nassl
    running build_ext
    building 'nassl._nassl_legacy' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/nassl
    creating build/temp.linux-x86_64-3.6/nassl/_nassl
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DLEGACY_OPENSSL=1 -I/tmp/pip-8zmtyiqd-build/deps/openssl-OpenSSL_1_0_2e/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/nassl.c -o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o -Wall
  ...
    gcc -pthread -shared -Wl,-z,relro -g build/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o build/temp.linux-x86_64-3.6 /nassl/_nassl/nassl_SSL.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o build/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o build/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o build/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o /tmp/pip-p2iu12r6-build/deps/openssl-OpenSSL_1_0_2e/libssl.a /tmp/pip-p2iu12r6-build/deps/openssl-OpenSSL_1_0_2e/libcrypto.a /tmp/pip-p2iu12r6-build/deps/zlib-1.2.11/libz.a -L/usr/lib64 -lpython3.6m -o build/lib.linux-x86_64-3.6/nassl/_nassl_legacy.cpython-36m-x86_64-linux-gnu.so -Wl,-z,noexecstack
    gcc: error: /tmp/pip-p2iu12r6-build/deps/openssl-OpenSSL_1_0_2e/libssl.a: No such file or directory
    gcc: error: /tmp/pip-p2iu12r6-build/deps/openssl-OpenSSL_1_0_2e/libcrypto.a: No such file or directory
    gcc: error: /tmp/pip-p2iu12r6-build/deps/zlib-1.2.11/libz.a: No such file or directory
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-p2iu12r6-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-net6kca1-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-p2iu12r6-build/

The mentioned static libs are presented by OS packages:

$ rpm -qal | egrep 'lib(ssl|crypto|z).a'
/opt/puppetlabs/puppet/lib/libcrypto.a
/opt/puppetlabs/puppet/lib/libssl.a
/usr/lib64/libz.a
/usr/lib64/libcrypto.a
/usr/lib64/libssl.a

And their versions:

$ rpm -qf $(rpm -qal | egrep 'lib64/lib(ssl|crypto|z).a')
zlib-static-1.2.7-19.el7_9.x86_64
openssl-static-1.0.2k-21.el7_9.x86_64
openssl-static-1.0.2k-21.el7_9.x86_64

Any ideas on how to proceed and get the updated version?

Alpine Linux: _nassl.so: setcontext: symbol not found

I'm trying to build sslyze on Alpine Linux. This is working fine for 1.1.5 and earlier. Since 1.2.0 it seems to build fine but fails on runtime:

/ # sslyze 
Traceback (most recent call last):
  File "/usr/bin/sslyze", line 11, in <module>
    load_entry_point('SSLyze==1.2.0', 'console_scripts', 'sslyze')()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/site-packages/sslyze/__main__.py", line 12, in <module>
    from sslyze.concurrent_scanner import ConcurrentScanner
  File "/usr/lib/python2.7/site-packages/sslyze/concurrent_scanner.py", line 9, in <module>
    from sslyze.plugins.plugin_base import PluginScanResult
  File "/usr/lib/python2.7/site-packages/sslyze/plugins/plugin_base.py", line 12, in <module>
    from sslyze.server_connectivity import ServerConnectivityInfo
  File "/usr/lib/python2.7/site-packages/sslyze/server_connectivity.py", line 13, in <module>
    from nassl.ssl_client import ClientCertificateRequested, OpenSslVersionEnum
  File "/usr/lib/python2.7/site-packages/nassl/ssl_client.py", line 7, in <module>
    from nassl import _nassl
ImportError: Error relocating /usr/lib/python2.7/site-packages/nassl/_nassl.so: setcontext: symbol not found

Looking into requirements.txt it seems that the minimum version for nassl bumped to nassl>=1.0.0,<1.1.0 in sslyze 1.2.0.

I get ModuleNotFoundError: No module named 'nassl.cert_chain_verifier'

#75 I tried compiling and installing nassl using Pythin 3.6.8.
Now I get following error by trying to use it with older version of sslyze.
But I am not sure this is Python version related:

$ python3 -m sslyze --version
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/admin2/sslyze/sslyze/__main__.py", line 6, in <module>
    from sslyze.cli.output_hub import OutputHub
  File "/home/admin2/sslyze/sslyze/cli/output_hub.py", line 4, in <module>
    from sslyze.cli.command_line_parser import ParsedCommandLine
  File "/home/admin2/sslyze/sslyze/cli/command_line_parser.py", line 14, in <module>
    from sslyze.plugins.scan_commands import ScanCommandType, ScanCommandsRepository
  File "/home/admin2/sslyze/sslyze/plugins/scan_commands.py", line 5, in <module>
    from sslyze.plugins.certificate_info.implementation import CertificateInfoImplementation
  File "/home/admin2/sslyze/sslyze/plugins/certificate_info/implementation.py", line 9, in <module>
    from sslyze.plugins.certificate_info._cert_chain_analyzer import (
  File "/home/admin2/sslyze/sslyze/plugins/certificate_info/_cert_chain_analyzer.py", line 14, in <module>
    from nassl.cert_chain_verifier import CertificateChainVerifier, CertificateChainVerificationFailed
ModuleNotFoundError: No module named 'nassl.cert_chain_verifier'

I took a look at dot-seprated module names:

$ grep \\..*import nassl/ssl_client.py
from nassl._nassl import WantReadError, OpenSSLError, WantX509LookupError
from nassl.ocsp_response import OcspResponse
from nassl.ephemeral_key_info import (
from nassl.cert_chain_verifier import CertificateChainVerificationFailed

These looks like they are all present:

$ grep \\..*import nassl/ssl_client.py | awk '{sub(/\./, "/", $2); print $2}' | while read LINE; do eval ls -ld $LINE"@(|.py)"; done
drwxrwxr-x 2 admin2 admin2 4096 Mar 20 01:34 nassl/_nassl
-rw-rw-r-- 1 admin2 admin2 7319 Mar 20 01:34 nassl/ocsp_response.py
-rw-rw-r-- 1 admin2 admin2 5076 Mar 20 01:34 nassl/ephemeral_key_info.py
-rw-rw-r-- 1 admin2 admin2 3020 Mar 20 01:22 nassl/cert_chain_verifier.py

But only the nassl/cert_chain_verifier.py seems to be failing.

Would you help me to understand the issue?

pip can't find nassl package when using debug version of python

I think there is something odd about the nassl wheel. I'm using pyenv, and if I use version 3.6.4 of python then pip finds the most recent version of nassl. If I use pyenv to install a debug build of the same version of python, though, then pip fails to find a suitable version of nassl:

Collecting nassl<1.2.0,>=1.1.0 (from sslyze>=1.4.0->-r requirements.txt (line 28))
  Could not find a version that satisfies the requirement nassl<1.2.0,>=1.1.0 (from sslyze>=1.4.0->-r requirements.txt (line 28)) (from versions: 0.13.4.win32, 0.13.1, 0.13.2, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.17.0, 1.0.1, 1.0.2, 1.0.3)
No matching distribution found for nassl<1.2.0,>=1.1.0 (from sslyze>=1.4.0->-r requirements.txt (line 28))

nassl is the only package that seems to care if I'm using a debug version of python.

Error when installing from git clone

I wanted to install newest nassl version, which is required to install sslyze. Newest version in pip is 1.03 so i tried to install from git clone.
When running command python sample_client.py i got error:
Traceback (most recent call last): File "sample_client.py", line 7, in <module> from nassl.ssl_client import OpenSslVersionEnum, SslClient File "/home/kali/nassl/nassl/ssl_client.py", line 7, in <module> from nassl import _nassl # type: ignore ImportError: /home/kali/nassl/nassl/_nassl.so: undefined symbol: SSL_SESSION_set_max_early_data

Building from scratch also didn't work for me. Any ideas what to do with that?

QA Notice: Package triggers severe warnings

The GCC has an internal checks which could determine code mistakes on the early stage. It can be enabled using -Wall flag. Currently, there are several problems detected:

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -Ibin/openssl-modern/include -Inassl/_nassl -I/usr/include/python3.6m -c nassl/_nassl/python_utils.c -o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o -Wall
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -march=native -O2 -pipe /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_CTX.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_errors.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_BIO.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_EXTENSION.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_X509_NAME_ENTRY.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_SSL_SESSION.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/openssl_utils.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/nassl_OCSP_RESPONSE.o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/temp.linux-x86_64-3.6/nassl/_nassl/python_utils.o bin/openssl-modern/linux64/libssl.a bin/openssl-modern/linux64/libcrypto.a bin/zlib/linux64/libz.a -L/usr/lib64 -lpython3.6m -o /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/_nassl.cpython-36m-x86_64-linux-gnu.so -Wl,-z,noexecstack
>>> Source compiled.
>>> Test phase [not enabled]: dev-python/nassl-1.1.3-r1

>>> Install nassl-1.1.3-r1 into /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/ category dev-python
 * python2_7: running distutils-r1_run_phase distutils-r1_python_install
python2.7 setup.py install --root=/var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7
running install
running build
running build_py
running build_ext
running install_lib
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python2_7/lib/nassl/_nassl.so -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python2_7/lib/nassl/_nassl_legacy.so -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python2_7/lib/nassl/ocsp_response.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python2_7/lib/nassl/legacy_ssl_client.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python2_7/lib/nassl/ssl_client.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python2_7/lib/nassl/__init__.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl/ocsp_response.py to ocsp_response.pyc
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl/legacy_ssl_client.py to legacy_ssl_client.pyc
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl/ssl_client.py to ssl_client.pyc
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl/__init__.py to __init__.pyc
writing byte-compilation script '/var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmpnD4NA3.py'
/usr/bin/python2.7 -OO /var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmpnD4NA3.py
removing /var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmpnD4NA3.py
running install_egg_info
running egg_info
writing requirements to nassl.egg-info/requires.txt
writing nassl.egg-info/PKG-INFO
writing top-level names to nassl.egg-info/top_level.txt
writing dependency_links to nassl.egg-info/dependency_links.txt
reading manifest file 'nassl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'nassl.egg-info/SOURCES.txt'
Copying nassl.egg-info to /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python2.7/usr/lib64/python2.7/site-packages/nassl-1.1.3-py2.7.egg-info
running install_scripts
 * python3_6: running distutils-r1_run_phase distutils-r1_python_install
python3.6 setup.py install --root=/var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6
running install
running build
running build_py
running build_ext
running install_lib
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages
creating /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/_nassl.cpython-36m-x86_64-linux-gnu.so -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/_nassl_legacy.cpython-36m-x86_64-linux-gnu.so -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/ocsp_response.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/legacy_ssl_client.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/ssl_client.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
copying /var/tmp/portage/dev-python/nassl-1.1.3-r1/work/nassl-1.1.3-python3_6/lib/nassl/__init__.py -> /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl/ocsp_response.py to ocsp_response.cpython-36.pyc
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl/legacy_ssl_client.py to legacy_ssl_client.cpython-36.pyc
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl/ssl_client.py to ssl_client.cpython-36.pyc
byte-compiling /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl/__init__.py to __init__.cpython-36.pyc
writing byte-compilation script '/var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmp4pry6si5.py'
/usr/bin/python3.6 /var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmp4pry6si5.py
removing /var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmp4pry6si5.py
writing byte-compilation script '/var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmpst37l7on.py'
/usr/bin/python3.6 /var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmpst37l7on.py
removing /var/tmp/portage/dev-python/nassl-1.1.3-r1/temp/tmpst37l7on.py
running install_egg_info
running egg_info
writing nassl.egg-info/PKG-INFO
writing dependency_links to nassl.egg-info/dependency_links.txt
writing requirements to nassl.egg-info/requires.txt
writing top-level names to nassl.egg-info/top_level.txt
reading manifest file 'nassl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'nassl.egg-info/SOURCES.txt'
Copying nassl.egg-info to /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/_python3.6/usr/lib64/python3.6/site-packages/nassl-1.1.3-py3.6.egg-info
running install_scripts
 * python3_6: running distutils-r1_run_phase distutils-r1_python_install_all
>>> Completed installing nassl-1.1.3-r1 into /var/tmp/portage/dev-python/nassl-1.1.3-r1/image/

 * Final size of build directory: 227748 KiB (222.4 MiB)
 * Final size of installed tree:   14604 KiB ( 14.2 MiB)


 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * nassl/_nassl/nassl_SSL_CTX.c:383:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL.c:297:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL.c:301:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL.c:1050:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509.c:387:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_BIO.c:200:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_EXTENSION.c:77:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_EXTENSION.c:81:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_EXTENSION.c:154:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_NAME_ENTRY.c:164:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL_SESSION.c:137:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_OCSP_RESPONSE.c:205:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL_CTX.c:383:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL.c:297:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL.c:301:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL.c:1050:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509.c:387:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_BIO.c:200:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_EXTENSION.c:77:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_EXTENSION.c:81:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_EXTENSION.c:154:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_X509_NAME_ENTRY.c:164:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_SSL_SESSION.c:137:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * nassl/_nassl/nassl_OCSP_RESPONSE.c:205:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
 * Homepage: https://github.com/nabla-c0d3/nassl

It is possible to disable these warnings with "--no-string-aliasing" flag but it just hides the problem.
I suggest to have a look at the root cause and fix it.

Add support for ARM64

  • IMPORTANT: 25 config files in '/etc/portage' need updating.
  • See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
  • sections of the emerge man page to learn how to update config files.
    Calculating dependencies... done!

Verifying ebuild manifests
Emerging (1 of 4) dev-python/nassl-1.1.0::pentoo
Failed to emerge dev-python/nassl-1.1.0, Log file:
'/var/log/portage/dev-python:nassl-1.1.0:20180613-012140.log'
Jobs: 0 of 4 complete, 1 failed Load avg: 9.27, 8.60, 7.05
*** Resuming merge...
Calculating dependencies... done!

  • Package: dev-python/nassl-1.1.0
  • Repository: pentoo
  • USE: arm64 elibc_glibc kernel_linux python_targets_python2_7 python_targets_python3_4 python_targets_python3_5 python_targets_python3_6 userland_GNU
  • FEATURES: compressdebug distcc preserve-libs sandbox splitdebug userpriv usersandbox

cfg-update-1.8.2-r1: Skipping checksum index updating...
Unpacking source...
Unpacking nassl-1.1.0.tar.gz to /var/tmp/portage/dev-python/nassl-1.1.0/work
Source unpacked in /var/tmp/portage/dev-python/nassl-1.1.0/work
Preparing source in /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0 ...
Source prepared.
Configuring source in /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0 ...
Source configured.
Compiling source in /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0 ...

  • python2_7: running distutils-r1_run_phase distutils-r1_python_compile
    python2.7 setup.py build
    running build
    running build_py
    creating /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/lib/nassl
    copying nassl/init.py -> /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/lib/nassl
    copying nassl/ssl_client.py -> /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/lib/nassl
    copying nassl/legacy_ssl_client.py -> /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/lib/nassl
    copying nassl/ocsp_response.py -> /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/lib/nassl
    warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building 'nassl._nassl_legacy' extension
creating /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7
creating /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl
creating /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl.o -Wall
distcc[26523] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL_CTX.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL_CTX.o -Wall
distcc[26534] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL.o -Wall
distcc[26549] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509.o -Wall
distcc[26562] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_errors.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_errors.o -Wall
distcc[26574] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
In file included from /usr/include/python2.7/Python.h:8:0,
from nassl/_nassl/nassl_errors.h:3,
from nassl/_nassl/nassl_errors.c:10:
/usr/include/python2.7/pyconfig.h:1193:0: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L

In file included from /usr/include/bits/libc-header-start.h:33:0,
from /usr/include/stdio.h:28,
from bin/openssl-legacy/include/openssl/err.h:118,
from nassl/_nassl/nassl_errors.c:2:
/usr/include/features.h:257:0: note: this is the location of the previous definition

define _POSIX_C_SOURCE 200809L

aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_BIO.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_BIO.o -Wall
distcc[26595] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509_EXTENSION.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509_EXTENSION.o -Wall
distcc[26618] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509_NAME_ENTRY.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o -Wall
distcc[26635] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL_SESSION.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL_SESSION.o -Wall
distcc[26658] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/openssl_utils.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/openssl_utils.o -Wall
distcc[26677] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_OCSP_RESPONSE.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o -Wall
distcc[26693] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/python_utils.c -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/python_utils.o -Wall
distcc[26707] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,noexecstack -O2 -pipe -fno-strict-aliasing /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL_CTX.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_errors.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_BIO.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509_EXTENSION.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_SSL_SESSION.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/openssl_utils.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/temp.linux-aarch64-2.7/nassl/_nassl/python_utils.o bin/openssl-legacy/linux64/libssl.a bin/openssl-legacy/linux64/libcrypto.a bin/zlib/linux64/libz.a -L/usr/lib64 -lpython2.7 -o /var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0-python2_7/lib/nassl/_nassl_legacy.so -Wl,-z,noexecstack
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: bin/openssl-legacy/linux64/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 62)
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: bin/openssl-legacy/linux64/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 62)
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: bin/openssl-legacy/linux64/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 62)
bin/openssl-legacy/linux64/libssl.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
distcc[26718] ERROR: compile (null) on localhost failed
error: command 'aarch64-unknown-linux-gnu-gcc' failed with exit status 1

  • ERROR: dev-python/nassl-1.1.0::pentoo failed (compile phase):
  • (no error message)
  • Call stack:
  • ebuild.sh, line  124:  Called src_compile
    
  • environment, line 3905: Called distutils-r1_src_compile
  • environment, line 1039: Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
  • environment, line 363: Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
  • environment, line 3380: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
  • environment, line 2544: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
  • environment, line 2542: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
  • environment, line 687: Called distutils-r1_run_phase 'distutils-r1_python_compile'
  • environment, line 1030: Called distutils-r1_python_compile
  • environment, line 905: Called esetup.py 'build'
  • environment, line 1589: Called die
  • The specific snippet of code:
  •   "${@}" || die "${die_args[@]}";
    
  • If you need support, post the output of emerge --info '=dev-python/nassl-1.1.0::pentoo',
  • the complete build log and the output of emerge -pqv '=dev-python/nassl-1.1.0::pentoo'.
  • The complete build log is located at '/var/log/portage/dev-python:nassl-1.1.0:20180613-012140.log'.
  • For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/nassl-1.1.0/temp/build.log'.
  • The ebuild environment file is located at '/var/tmp/portage/dev-python/nassl-1.1.0/temp/environment'.
  • Working directory: '/var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0'
  • S: '/var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0'
  • One or more packages are either masked or have missing dependencies:
  • sys-libs/binutils-libs:0/2.28= pulled in by:
  • (x11-libs/cairo-1.14.10:0/0::gentoo, installed)
    
  • dev-libs/openssl:0=[bindist] pulled in by:
  • (dev-qt/qtnetwork-5.9.5:5/5.9::gentoo, installed)
    
  • =media-plugins/alsa-plugins-1.0.27-r1[pulseaudio] pulled in by:

  • (media-sound/pulseaudio-11.1-r1-1:0/0::gentoo, installed)
    
  • net-misc/mobile-broadband-provider-info pulled in by:
  • (net-misc/ofono-1.20:0/0::gentoo, installed)
    
  • The resume list contains packages that are either masked or have
  • unsatisfied dependencies. Please restart/continue the operation
  • manually, or use --skipfirst to skip the first package in the list and
  • any other packages that may be masked or have missing dependencies.
  • The following package has failed to build, install, or execute postinst:
  • (dev-python/nassl-1.1.0:0/0::pentoo, ebuild scheduled for merge), Log file:
  • '/var/log/portage/dev-python:nassl-1.1.0:20180613-012140.log'

scw-89ba37 /usr/portage/packages/app-admin/equo # nano /var/log/portage/dev-python:nassl-1.1.0:20180613-012140.log
GNU nano 2.8.7 File: /var/log/portage/dev-python:nassl-1.1.0:20180613-012140.log

distcc[26693] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -O2 -pipe -fno-strict-aliasing -fPIC -DLEGACY_OPENSSL=1 -Ibin/openssl-legacy/include -Inassl/_$
distcc[26707] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
aarch64-unknown-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-z,noexecstack -O2 -pipe -fno-strict-aliasing /var/tmp/por$
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: bin/openssl-legacy/linux64/libssl$
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: bin/openssl-legacy/linux64/libssl$
/usr/lib/gcc/aarch64-unknown-linux-gnu/7.3.0/../../../../aarch64-unknown-linux-gnu/bin/ld: bin/openssl-legacy/linux64/libssl$
bin/openssl-legacy/linux64/libssl.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
distcc[26718] ERROR: compile (null) on localhost failed
error: command 'aarch64-unknown-linux-gnu-gcc' failed with exit status 1

  • ERROR: dev-python/nassl-1.1.0::pentoo failed (compile phase):
  • (no error message)
  • Call stack:
  • ebuild.sh, line  124:  Called src_compile
    
  • environment, line 3905: Called distutils-r1_src_compile
  • environment, line 1039: Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
  • environment, line 363: Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
  • environment, line 3380: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distu$
  • environment, line 2544: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_pyt$
  • environment, line 2542: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
  • environment, line 687: Called distutils-r1_run_phase 'distutils-r1_python_compile'
  • environment, line 1030: Called distutils-r1_python_compile
  • environment, line 905: Called esetup.py 'build'
  • environment, line 1589: Called die
  • The specific snippet of code:
  •   "${@}" || die "${die_args[@]}";
    
  • If you need support, post the output of emerge --info '=dev-python/nassl-1.1.0::pentoo',
  • the complete build log and the output of emerge -pqv '=dev-python/nassl-1.1.0::pentoo'.
  • The complete build log is located at '/var/log/portage/dev-python:nassl-1.1.0:20180613-012140.log'.
  • For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/nassl-1.1.0/temp/build.log'.
  • The ebuild environment file is located at '/var/tmp/portage/dev-python/nassl-1.1.0/temp/environment'.
  • Working directory: '/var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0'
  • S: '/var/tmp/portage/dev-python/nassl-1.1.0/work/nassl-1.1.0'

OpenSSLError: error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers

I am trying to run a django application with sslyze. When using the development server, everything works. When I try to setup an nginx/uwsgi stack, I get the following issue:

OpenSSLError: error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers

  File "django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "secureweb/main/views.py", line 29, in get
    response = test_server_connection(parsed_url.netloc)
  File "secureweb/main/utils.py", line 14, in test_server_connection
    server_info = server_tester.perform()
  File "sslyze/server_connectivity_tester.py", line 207, in perform
    should_ignore_client_auth=True,
  File "sslyze/utils/ssl_connection_configurator.py", line 70, in get_connection
    should_use_legacy_openssl=final_should_use_legacy_openssl,
  File "sslyze/utils/ssl_connection.py", line 142, in __init__
    ignore_client_authentication_requests=should_ignore_client_auth)
  File "nassl/legacy_ssl_client.py", line 41, in __init__
    self._init_base_objects(ssl_version, underlying_socket)
  File "nassl/ssl_client.py", line 113, in _init_base_objects
    self._ssl_ctx = self._NASSL_MODULE.SSL_CTX(ssl_version.value)

The server raises a 500 error.
I am using ubuntu18, python3.6.6 and openssl1.1.1a, nassl2.1.1, sslyze2.0.1
Can you please give me a hint to what can be causing this issue?

Name of Elliptic Curves

Maybe it would be nice to display the name of the curves.

AND if you consider to find out the DHE and ECDHE public keys, it would be possible to check if the server reuse those Keys.

DHE/ECDHE means "temporary" keys.
as i suppose so far, it means: you dont need a specific key for your key exchange. for each handshake there will be a new generated key. and if you reuse this "temporary" keys, an attacker could find out about your privat key.

until now, i do not really understand the whole concept behind but it seems to be really bad :D

ARM support?

Trying to install on my Chromebook as part of pshtt -- looks like there's no ARM version of the openssl fork. Not sure if that's easy to get, or if should just add a note in the README that it only works on x86/64.

Building wheels for collected packages: nassl
  Running setup.py bdist_wheel for nassl ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wu4wk6/nassl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpsuzraPpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-2.7
  creating build/lib.linux-armv7l-2.7/nassl
  copying nassl/__init__.py -> build/lib.linux-armv7l-2.7/nassl
  copying nassl/ssl_client.py -> build/lib.linux-armv7l-2.7/nassl
  copying nassl/debug_ssl_client.py -> build/lib.linux-armv7l-2.7/nassl
  copying nassl/ocsp_response.py -> build/lib.linux-armv7l-2.7/nassl
  running build_ext
  building 'nassl._nassl' extension
  creating build/temp.linux-armv7l-2.7
  creating build/temp.linux-armv7l-2.7/nassl
  creating build/temp.linux-armv7l-2.7/nassl/_nassl
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL_CTX.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_CTX.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_errors.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_errors.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_BIO.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_BIO.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509_EXTENSION.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_EXTENSION.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509_NAME_ENTRY.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL_SESSION.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_SESSION.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/openssl_utils.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/openssl_utils.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_OCSP_RESPONSE.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o -Wall
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/python_utils.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/python_utils.o -Wall
  arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/nassl/_nassl/nassl.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_CTX.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_errors.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_BIO.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_EXTENSION.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_SESSION.o build/temp.linux-armv7l-2.7/nassl/_nassl/openssl_utils.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o build/temp.linux-armv7l-2.7/nassl/_nassl/python_utils.o /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libcrypto.a /tmp/pip-build-Wu4wk6/nassl/bin/zlib/linux32/libz.a -o build/lib.linux-armv7l-2.7/nassl/_nassl.so
  /usr/bin/ld: /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 3)
  /usr/bin/ld: /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 3)
  /usr/bin/ld: /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 3)
  /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a: error adding symbols: File in wrong format
  collect2: error: ld returned 1 exit status
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for nassl
  Running setup.py clean for nassl
Failed to build nassl
Installing collected packages: nassl, sslyze, pathvalidate, dominate, logbook, pytz, python-dateutil, mbstrdecoder, typepy, DataProperty, beautifulsoup4, pyparsing, markdown2, functools32, jsonschema, xlrd, SimpleSQLite, path.py, pytablereader, XlsxWriter, xlwt, toml, pytablewriter, pshtt
  Running setup.py install for nassl ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wu4wk6/nassl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-AmuWGO-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-2.7
    creating build/lib.linux-armv7l-2.7/nassl
    copying nassl/__init__.py -> build/lib.linux-armv7l-2.7/nassl
    copying nassl/ssl_client.py -> build/lib.linux-armv7l-2.7/nassl
    copying nassl/debug_ssl_client.py -> build/lib.linux-armv7l-2.7/nassl
    copying nassl/ocsp_response.py -> build/lib.linux-armv7l-2.7/nassl
    running build_ext
    building 'nassl._nassl' extension
    creating build/temp.linux-armv7l-2.7
    creating build/temp.linux-armv7l-2.7/nassl
    creating build/temp.linux-armv7l-2.7/nassl/_nassl
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL_CTX.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_CTX.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_errors.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_errors.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_BIO.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_BIO.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509_EXTENSION.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_EXTENSION.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_X509_NAME_ENTRY.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_SSL_SESSION.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_SESSION.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/openssl_utils.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/openssl_utils.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/nassl_OCSP_RESPONSE.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o -Wall
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ibin/openssl/include -Inassl/_nassl -I/usr/include/python2.7 -c nassl/_nassl/python_utils.c -o build/temp.linux-armv7l-2.7/nassl/_nassl/python_utils.o -Wall
    arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/nassl/_nassl/nassl.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_CTX.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_errors.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_BIO.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_EXTENSION.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_X509_NAME_ENTRY.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_SSL_SESSION.o build/temp.linux-armv7l-2.7/nassl/_nassl/openssl_utils.o build/temp.linux-armv7l-2.7/nassl/_nassl/nassl_OCSP_RESPONSE.o build/temp.linux-armv7l-2.7/nassl/_nassl/python_utils.o /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libcrypto.a /tmp/pip-build-Wu4wk6/nassl/bin/zlib/linux32/libz.a -o build/lib.linux-armv7l-2.7/nassl/_nassl.so
    /usr/bin/ld: /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 3)
    /usr/bin/ld: /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 3)
    /usr/bin/ld: /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a(s2_meth.o): Relocations in generic ELF (EM: 3)
    /tmp/pip-build-Wu4wk6/nassl/bin/openssl/linux32/libssl.a: error adding symbols: File in wrong format
    collect2: error: ld returned 1 exit status
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Wu4wk6/nassl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-AmuWGO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Wu4wk6/nassl/

UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 4279: invalid continuation byte

When running the "pshtt" tool, as it uses "sslyze" and, therefore, "nassl", when the "ocsp_response.py" tool (or plugin) is executed, the following error is generated, due to an unexpected, or badly encoded, character in the OCSP response:

  File "/home/<user>/.local/lib/python2.7/site-packages/nassl/ocsp_response.py", line 60, in as_dict
    response_text = self.as_text()
  File "/home/<user>/.local/lib/python2.7/site-packages/nassl/ocsp_response.py", line 30, in as_text
    return self._ocsp_response.as_text()
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 4279: invalid continuation byte

I originally saw this error with nassl version 0.16.3 (in Kali Linux), but I can also reproduce it with the latest nassl version, 1.0.2.

I can submit privately the target hostname that generates this error in case you are interested in adding code to manage "strange" characters or other encoding formats.

Implementing TLS Extension for Certificate Transparency

Hi,

I am looking to implement the usage of the TLS Extension for Certificate Transparency.
From openssl itself it can be queried like that:
openssl s_client -serverinfo 18 -connect google.com:443 </dev/null 2>/dev/null | sed -n -e "/BEGIN SERVERINFO/,/END SERVERINFO/p"

The SCT is only sent if the client signals the support for the extension per https://tools.ietf.org/html/rfc6962#section-3.3.1

Further methods to serve the SCT is via OCSP or directly inside the Certificate. The SCT included in the OCSP response can be parsed already form the response and I will send in a pull request after I cleaned it up a little bit.

Where would I start to implement this feature?

Kind Regards.

Source distribution on PyPI?

Is it possible to include a source distribution on PyPI? I run sslyze in an Alpine Linux Docker container and, since Alpine uses musl instead of glibc, the wheels in PyPI don't work for me.

I suspect a lot of folks will run into the same issue, since Alpine is a pretty popular Linux distribution for use in Docker containers due to its small footprint.

Installation of nassl via pip on TravisCI Ubuntu Trusty boxes

Hi,
I've just opened #17 about the current data quota stopping users from cloning and pulling this repo.

A big part of why we clone this repo is because we need to install it (and sslyze) on TravisCI. pip install fails on those machines (last I tried, which admittedly was on the beta Trusty machines, not on the new Trusty machines TravisCI recently announced).

If we enabled installation of nassl via pip on Travis' Ubuntu Trusty, our bandwidth usage of git-lfs would drop to near zero, and I suspect might help others as well.

Would you be open to a pull-request with updated binaries for Ubuntu Trusty (for testing on TravisCI)? What other distributions are these binaries aimed at?

Of course, to do this I would need to be able to interact with the repo, which requires some resolution to happen in #17.

Can't install nassl 2.2.0 with Python 3.7

When trying to install the new version (2.2.0) of nassl on Python 3.7 it returns the following error.

$ pip3 install nassl==2.2.0
Collecting nassl==2.2.0
  Could not find a version that satisfies the requirement nassl==2.2.0 (from versions: 0.13.4.win32, 0.13.1, 0.13.2, 0.13.4, 0.13.5, 0.13.6, 0.13.7, 0.14.0, 0.14.1, 0.14.2, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.17.0, 1.0.1, 1.0.2, 1.0.3, 2.1.0, 2.1.1, 2.1.2)
No matching distribution found for nassl==2.2.0

With Python 3.6 however, it works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.