Skip to main content
QMSQMS
QMS
  • Welcome to your QMS
  • Quality Manual
  • Procedures
  • Records
  • Legit.Health Plus Version 1.1.0.0
    • CAPA Plan - BSI CE Mark Closeout
    • Index
    • Overview and Device Description
    • Information provided by the Manufacturer
    • Design and Manufacturing Information
      • R-TF-012-019 SOUPs
        • Aioboto3
        • Albumentations
        • Argon2-CFFI
        • Authlib
        • Boto3
        • Dependency Injector
        • Dill
        • FastAPI
        • PyTorch Grad-CAM
        • Httpx
        • NumPy
        • PyNVML
        • OpenCV
        • Pillow
        • Psutil
        • Pydantic
        • Pydantic Settings
        • PyYAML
        • Segmentation Models PyTorch
        • Starlette
        • Timm
        • PyTorch
        • TorchVision
        • Ultralytics YOLO
        • Uvicorn
      • R-TF-012-028 Software Requirement Specification
      • R-TF-012-029 Software Architecture Description
      • R-TF-012-030 Software Configuration Management Plan
      • R-TF-012-031 Product requirements specification
      • R-TF-012-037 Labeling and IFU Requirements
      • R-TF-012-040 Documentation level FDA
      • R-TF-012-041 Software Classification 62304
      • R-TF-012-043 Traceability Matrix
      • Review meetings
    • GSPR
    • Benefit-Risk Analysis and Risk Management
    • Product Verification and Validation
    • Post-Market Surveillance
  • Legit.Health Plus Version 1.1.0.1
  • Legit.Health Utilities
  • Licenses and accreditations
  • Applicable Standards and Regulations
  • Pricing
  • Public tenders
  • Legit.Health Plus Version 1.1.0.0
  • Design and Manufacturing Information
  • R-TF-012-019 SOUPs
  • Httpx

Httpx

General Information​

FieldValue
Package Namehttpx
Manufacturer / VendorEncode (Tom Christie and contributors)
Software CategoryLibrary
Primary DocumentationDocumentation, GitHub, PyPI
Programming Language(s)Python
LicenseBSD-3-Clause
Deployed Version(s)>=0.28.0 (version-locked at 0.28.1)
Most Recent Available Version0.28.1
Last Review Date2026-01-27

Overview​

httpx is a next-generation HTTP client for Python that provides both synchronous and asynchronous APIs with native support for HTTP/1.1 and HTTP/2 protocols. The library offers a requests-compatible API with modern async/await support, strict timeout handling, connection pooling, and comprehensive type annotations. With 14.9k+ GitHub stars and 100% test coverage, httpx has become the de facto standard for async HTTP communication in the Python ecosystem.

Within the medical device software, httpx serves as the foundational HTTP communication layer for all inter-service communication in the microservices architecture. The library is integrated into the legithp-essentials framework through the AsyncHttpClient wrapper, which provides enterprise-grade HTTP capabilities to all services including the control plane, API gateway, expert orchestrator, and clinical detector applications. Specifically, httpx is used for:

  • Asynchronous service-to-service communication: The AsyncHttpClient class wraps httpx.AsyncClient to provide non-blocking HTTP operations between microservices, enabling efficient handling of concurrent requests across the distributed system
  • Synchronous clinical detector clients: Clinical sign detection services (hair follicle detector, acneiform detector) use httpx.Client for blocking HTTP calls to specialized ML model endpoints
  • Connection pooling and resource management: httpx's Limits configuration enables efficient connection reuse with configurable pool sizes (max 100 connections, 20 keep-alive connections) to prevent resource exhaustion under load
  • Distributed tracing support: Correlation IDs are automatically injected into request headers via httpx's header management, enabling request tracing across the entire microservice mesh
  • Health monitoring infrastructure: Dedicated health check methods with shorter timeouts (5 seconds) use httpx to monitor service availability and readiness across the system

The library was selected for its async-first design compatible with FastAPI/Starlette, comprehensive timeout handling throughout the request lifecycle, connection pooling capabilities, robust exception hierarchy for granular error handling, and permissive BSD-3-Clause licensing suitable for commercial medical device software.

Functional Requirements​

The following functional capabilities of this SOUP are relied upon by the medical device software.

Requirement IDDescriptionSource / Reference
FR-001Execute asynchronous HTTP requests (GET, POST, PUT, PATCH, DELETE)httpx.AsyncClient methods
FR-002Execute synchronous HTTP requests for blocking operationshttpx.Client methods
FR-003Automatic JSON serialization and deserialization of request/response bodiesjson parameter, response.json()
FR-004Connection pooling with configurable limits for connection reusehttpx.Limits class
FR-005Configurable timeout handling for connect, read, write, and pool operationshttpx.Timeout class
FR-006Custom header injection for correlation ID propagationheaders parameter
FR-007Context manager support for proper resource cleanupasync with, with statements
FR-008Custom transport injection for testing with mock responsestransport parameter, MockTransport
FR-009Structured exception hierarchy for granular error handlingHTTPError, TimeoutException, etc.

Performance Requirements​

The following performance expectations are relevant to the medical device software.

Requirement IDDescriptionAcceptance Criteria
PR-001HTTP requests shall complete within configured timeout boundsRequests timeout appropriately; no indefinite blocking
PR-002Connection pooling shall reduce connection establishment overheadReused connections for repeated requests to same host
PR-003Async operations shall not block the event loopNon-blocking I/O enabling concurrent request handling
PR-004Memory usage shall remain stable during sustained request activityNo memory leaks during prolonged operation; connections properly released

Hardware Requirements​

The following hardware dependencies or constraints are imposed by this SOUP component.

Requirement IDDescriptionNotes / Limitations
HR-001Network interface for HTTP/HTTPSStandard TCP/IP networking required
HR-002x86-64 or ARM64 processor architecturePre-built wheels available for common platforms

Software Requirements​

The following software dependencies and environmental assumptions are required by this SOUP component.

Requirement IDDescriptionDependency / Version Constraints
SR-001Python runtime environmentPython >=3.8
SR-002httpcore for underlying transport layerBundled dependency (automatically installed)
SR-003h11 for HTTP/1.1 protocol implementationBundled dependency (automatically installed)
SR-004certifi for SSL certificate verificationBundled dependency (automatically installed)
SR-005idna for internationalized domain name supportBundled dependency (automatically installed)
SR-006sniffio for async library detectionBundled dependency (automatically installed)
SR-007asyncio event loop for async operationsPython standard library

Known Anomalies Assessment​

This section evaluates publicly reported issues, defects, or security vulnerabilities associated with this SOUP component and their relevance to the medical device software.

As of the review date (2026-01-27), no security vulnerabilities have been reported in the National Vulnerability Database (NVD), GitHub Security Advisories, or Snyk vulnerability database for the httpx package. The project maintains a security policy (SECURITY.md) and the maintainers (Encode organization) have a history of responsible security practices across their other projects (Starlette, uvicorn).

The device's usage pattern follows security best practices:

  • TLS verification enabled: All HTTPS connections use certificate verification via certifi, ensuring secure communication between services
  • Timeout enforcement: Strict timeouts are configured throughout (30 seconds default, 5 seconds for health checks, 120 seconds for ML operations), preventing indefinite resource blocking
  • Connection limits: Maximum connection pool sizes are configured to prevent resource exhaustion attacks
  • No external URL processing: All HTTP requests are made to internal microservices with pre-configured base URLs; no user-supplied URLs are processed through httpx
  • Header injection controls: Only controlled headers (correlation IDs, authentication tokens) are injected; no user-controlled header values
  • Error isolation: Custom exception hierarchy wraps httpx exceptions, preventing information leakage in error responses

Risk Control Measures​

The following risk control measures are implemented to mitigate potential security and operational risks associated with this SOUP component:

  • Version locking via requirements_lock.txt files ensures reproducible deployments across all services
  • All inter-service communication uses TLS with certificate verification
  • Timeout configuration prevents indefinite blocking
  • Connection pooling limits prevent resource exhaustion
  • No user-controlled URLs or headers are processed
  • Exponential backoff retry logic prevents cascade failures
  • Correlation ID propagation enables distributed tracing for security monitoring

Assessment Methodology​

The following methodology was used to identify and assess known anomalies:

  • Sources consulted:

    • National Vulnerability Database (NVD) search for "httpx"
    • GitHub Security Advisories for the encode/httpx repository
    • Snyk vulnerability database for package security analysis
    • PyPI package security reports
    • httpcore security advisories (as primary dependency)
  • Criteria for determining applicability:

    • Vulnerability must affect deployed version (0.28.1)
    • Vulnerability must be exploitable in the device's internal service-to-service communication context
    • Vulnerability must impact the specific features used (AsyncClient, Client, connection pooling, timeout handling)

Signature meaning

The signatures for the approval process of this document can be found in the verified commits at the repository for the QMS. As a reference, the team members who are expected to participate in this document and their roles in the approval process, as defined in Annex I Responsibility Matrix of the GP-001, are:

  • Author: Team members involved
  • Reviewer: JD-003, JD-004
  • Approver: JD-001
Previous
PyTorch Grad-CAM
Next
NumPy
  • General Information
  • Overview
  • Functional Requirements
  • Performance Requirements
  • Hardware Requirements
  • Software Requirements
  • Known Anomalies Assessment
    • Risk Control Measures
    • Assessment Methodology
All the information contained in this QMS is confidential. The recipient agrees not to transmit or reproduce the information, neither by himself nor by third parties, through whichever means, without obtaining the prior written permission of Legit.Health (AI Labs Group S.L.)