{"id":46428,"library":"spiffe-tls","title":"spiffe-tls","description":"Library for TLS authentication using SPIFFE identities in Python. Requires Python >=3.10. Current version: 0.3.2, released irregularly.","status":"active","version":"0.3.2","language":"python","source_language":"en","source_url":"https://github.com/HewlettPackard/py-spiffe","tags":["spiffe","tls","mTLS","spire","identity"],"install":[{"cmd":"pip install spiffe-tls","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core SPIFFE workload API and identity representation","package":"py-spiffe","optional":false},{"reason":"TLS certificate handling","package":"cryptography","optional":false},{"reason":"gRPC transport for workload API (used internally by py-spiffe)","package":"grpcio","optional":false}],"imports":[{"wrong":"from spiffetls import Identity","symbol":"ClientTlsMode","correct":"from spiffetls import ClientTlsMode"},{"symbol":"ServerTlsMode","correct":"from spiffetls import ServerTlsMode"},{"symbol":"create_ssl_context","correct":"from spiffetls import create_ssl_context"}],"quickstart":{"code":"import os\nfrom spiffetls import Identity, MTLSConnection\nfrom spiffetls import config\n\ndef test_connection():\n    # Create identity from environment or default path\n    identity = Identity(\n        spiffe_id=\"spiffe://example.org/workload\",\n        socket_path=os.environ.get(\"SPIFFE_ENDPOINT_SOCKET\", \"/run/spire/agent.sock\")\n    )\n    # Create TLS config\n    tls_config = config.TLSClientConfig(\n        spiffe_id_matcher=lambda id: id.trust_domain == \"example.org\",\n        identity=identity\n    )\n    conn = MTLSConnection(tls_config)\n    # Use conn to establish TLS connections\n    print(\"Configuration ready\")\n\ntest_connection()","lang":"python","description":"Initialize SPIFFE identity from environment and create mTLS connection config."},"warnings":[{"fix":"Update imports from spiffetls.TLS to spiffetls and use config.TLSClientConfig.","message":"The API changed significantly between 0.2.x and 0.3.x. In 0.3.x, MTLSConnection expects a config object instead of multiple parameters.","severity":"breaking","affected_versions":"0.3.0 and later"},{"fix":"Ensure the SPIFFE workload API is running and the socket path is correct.","message":"The SPIFFE identity is not automatically fetched from the default Workload API socket. You must specify socket_path or set SPIFFE_ENDPOINT_SOCKET environment variable.","severity":"gotcha","affected_versions":"All"},{"fix":"Upgrade to Python 3.10+.","message":"The library requires Python >=3.10. Using it with older Python versions will cause import errors.","severity":"gotcha","affected_versions":"All"},{"fix":"Use from spiffetls import ... instead of from spiffetls.TLS import ...","message":"The spiffetls.TLS module is deprecated in favor of top-level spiffetls.","severity":"deprecated","affected_versions":"0.3.0+"}],"env_vars":null,"search_vec":"'0.3.2':18 '3.10':15 'authent':7 'current':16 'ident':10,25 'irregular':20 'librari':4 'mtls':23 'python':12,14 'releas':19 'requir':13 'spiff':2,9,21 'spiffe-tl':1 'spire':24 'tls':3,6,22 'use':8 'version':17","created_at":"2026-06-07T12:59:52.327316+00:00","updated_at":"2026-06-07T12:59:52.327316+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/HewlettPackard/py-spiffe","github":"https://github.com/HewlettPackard/py-spiffe","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}