Skip to main content

Python interface to stunnel

Project description

Overview

Start and stop a stunnel instance given a stunnel configuration file.

The stunnel executable must be available on the system PATH. The configuration file must specify a PID file.

Installation

Use your favorite installer to install the pystunnel library and script. E.g.:

$ pip install pystunnel

Examples

From the command line:

$ pystunnel -c /path/to/stunnel.conf start
started
$ pystunnel -c /path/to/stunnel.conf check
running
$ pystunnel -c /path/to/stunnel.conf stop
stopped

If the command is omitted, pystunnel enters an interactive shell:

$ pystunnel -c /path/to/stunnel.conf
pystunnel> start
started
pystunnel> check
running
pystunnel> stop
stopped
pystunnel> quit
$

From Python:

from pystunnel import Stunnel
stunnel = Stunnel("/path/to/stunnel.conf")

rc = stunnel.start()
print("stunnel started with rc", rc)

if stunnel.check() == 0:
    print("stunnel is running with pid", stunnel.getpid())
else:
    print("stunnel is not running")

rc = stunnel.stop()
print("stunnel stopped with rc", rc)

Return Codes

0 means OK, 1 or higher means error.

Changelog

1.0a1 - 2016-03-14

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystunnel-1.0a1.zip (19.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page