Giter Site home page Giter Site logo

pombredanne / nassl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mfkiwl/nassl

0.0 0.0 0.0 27.88 MB

Experimental OpenSSL wrapper for Python 2.7 and SSLyze.

License: GNU General Public License v2.0

C 89.05% C++ 5.87% Objective-C 1.38% Python 3.70%

nassl's Introduction

nassl

Build Status

Experimental OpenSSL wrapper for Python 2.7 and SSLyze. Do NOT use for anything serious. This code has not been properly tested/reviewed and is absolutely not production ready.

Quick Start

Nassl can be installed directly via pip:

pip install nassl

On OS X and Linux, it is also easy to directly clone the repository, build the _nassl C extension and then run the sample client:

git clone https://github.com/nabla-c0d3/nassl.git
cd nassl
python setup.py build_ext -i
python sample_client.py

Building the C extension

Nassl relies on a C extension to call into OpenSSL; the extension can be directly built using the pre-compiled OpenSSL binaries available in ./bin, by running the following command:

python setup.py build_ext -i

On Windows, a "Platform Wheel" can be built using:

python setup.py bdist_wheel

If you do not want to use the pre-compiled binaries, compiling the C extension requires successively building:

The whole build process is all taken care of by the build_from_scratch.py script:

git clone https://github.com/nabla-c0d3/nassl.git
cd nassl
wget http://zlib.net/zlib-1.2.8.tar.gz
tar xvfz  zlib-1.2.8.tar.gz
git clone https://github.com/PeterMosmans/openssl
python build_from_scratch.py

For Windows builds, Visual Studio is expected to be installed at the default location.

The build script was tested on the following platforms: Windows 7 (32 and 64 bits), Debian 7 (32 and 64 bits), OS X El Capitan. It will build the C extension for the interpreter and platform that was used to run the script (ie. no cross-compiling).

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

Copyright 2015 Alban Diquet

Licensed under the GPLv2; see ./LICENSE

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

bcyrill avatar bluec0re avatar duongkai avatar elvanderb avatar kyprizel avatar mrcage avatar nabla-c0d3 avatar ralphdolmans avatar stefanb avatar

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.