2017-01-31 14:00:59 -03:00
Welcome
=======
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
`` wolfssl Python `` is a Python module that encapsulates `` wolfssl C `` , a `lightweight C-language-based SSL/TLS library <https://wolfssl.com/wolfSSL/Products-wolfssl.html> `_ targeted for embedded, RTOS, or
2016-12-22 16:59:50 -02:00
resource-constrained environments primarily because of its small size, speed,
2017-01-31 14:00:59 -03:00
and portability.
2016-09-04 18:31:53 -03:00
Installation
2017-02-05 18:56:19 -03:00
============
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
In order to use `` wolfssl Python `` , you'll also need to install `` wolfssl C `` .
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
Mac OSX
2017-02-05 18:56:19 -03:00
-------
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
Installing from `` homebrew `` and `` pip `` package managers:
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
.. code-block :: shell
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
# wolfssl C installation
2016-09-04 18:31:53 -03:00
brew install wolfssl
2017-01-31 14:00:59 -03:00
# wolfssl Python installation
sudo -H pip install wolfssl
Installing from `` source code `` :
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
.. code-block :: shell
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
# wolfssl C installation
2016-09-04 18:31:53 -03:00
git clone https://github.com/wolfssl/wolfssl.git
cd wolfssl/
./autogen.sh
./configure --enable-sha512
make
sudo make install
2017-01-31 14:00:59 -03:00
# wolfssl Python installation
cd wrapper/python/wolfssl
sudo make install
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
Linux
2017-02-05 18:56:19 -03:00
-----
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
.. code-block :: shell
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
# dependencies installation
2016-09-04 18:31:53 -03:00
sudo apt-get update
sudo apt-get install -y git autoconf libtool
2017-01-31 14:00:59 -03:00
sudo apt-get install -y python-dev python3-dev python-pip libffi-dev
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
# wolfssl C installation
2016-09-04 18:31:53 -03:00
git clone https://github.com/wolfssl/wolfssl.git
cd wolfssl/
./autogen.sh
./configure --enable-sha512
make
sudo make install
sudo ldconfig
2017-01-31 14:00:59 -03:00
# wolfssl Python installation
2016-09-04 18:31:53 -03:00
sudo -H pip install wolfssl
2017-01-31 14:00:59 -03:00
Testing
2017-02-05 18:56:19 -03:00
=======
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
To run the tox tests in the source code, you'll need `` tox `` and a few other
requirements. The source code relies at **WOLFSSL_DIR/wrapper/python/wolfssl**
where **WOLFSSL_DIR** is the path of `` wolfssl C `` 's source code.
2016-09-04 18:31:53 -03:00
1. Make sure that the testing requirements are installed:
2017-01-31 14:00:59 -03:00
.. code-block :: shell
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
sudo -H pip install -r requirements-testing.txt
2016-09-04 18:31:53 -03:00
2017-01-31 14:00:59 -03:00
2. Run `` make check `` :
2016-09-04 18:31:53 -03:00
.. code-block :: console
2017-01-31 14:00:59 -03:00
$ make check
2016-09-04 18:31:53 -03:00
...
_________________________________ summary _________________________________
py27: commands succeeded
SKIPPED: py34: InterpreterNotFound: python3.4
py35: commands succeeded
2017-01-31 14:00:59 -03:00
py36: commands succeeded
2016-09-04 18:31:53 -03:00
congratulations :)
Note: the test is performed using multiple versions of python. If you are
missing a version the test will be skipped with an **InterpreterNotFound
error**.