Skip to main content

SSL Adapter for requests library

Project description

Overview

SSL Adapter is a Python package that provides utilities for handling SSL connections and creating sessions with SSL adapters.

Installation

Install using pip:

pip install ssladapter

Usage

Creating a Session with SSL Adapter

To create a session with an SSL adapter, you can use the session_ssl_adapter function provided by the package.

from ssladapter.entry import session_ssl_adapter

# Create a session with SSL adapter
session = session_ssl_adapter(
    certfile='/path/to/client_certificate.pem',
    keyfile='/path/to/client_private_key.pem',
    password='your_password', # Optional
    cacertfile='/path/to/ca_certificate.pem' # Optional
)

# Use the session for making requests
response = session.get('https://example.com/api')

Creating an SSL Adapter

Alternatively, you can directly create an instance of the SSLAdapter class and use it to customize a session with SSL configuration.

from ssladapter.ssl_adapter import SSLAdapter
from requests import Session

# Create an SSL adapter instance
ssl_adapter = SSLAdapter(
    certfile='/path/to/client_certificate.pem',
    keyfile='/path/to/client_private_key.pem',
    password='your_password', # Optional
    cacertfile='/path/to/ca_certificate.pem' # Optional
)

# Create a session and mount the SSL adapter
session = Session()
session.mount('https://', ssl_adapter)

# Use the session for making requests
response = session.get('https://example.com/api')

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

ssladapter-0.1.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssladapter-0.1.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file ssladapter-0.1.3.tar.gz.

File metadata

  • Download URL: ssladapter-0.1.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for ssladapter-0.1.3.tar.gz
Algorithm Hash digest
SHA256 87db7949717ef8844428e92dfb63327d44078054de8d2618e0f63665d9b40ad0
MD5 1f12e190088b2d6a368ae441af12bbd1
BLAKE2b-256 ea82bf48b061cc3215677309ee96f95a0aaee6764fdb2d9a97d20229dbe1cd40

See more details on using hashes here.

File details

Details for the file ssladapter-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ssladapter-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for ssladapter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 de94e36bf1e99eded4df21faca64d7cd70003b8cd248c4362e0cd45db4577b48
MD5 68278290b90519ecddae639648a38247
BLAKE2b-256 67e4b0f98e02dca67164d98b522dcaca1d033f77ba0af8093407746e9fea32b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page