이 콘텐츠는 선택한 언어로 제공되지 않습니다.

8.2.8. Enable SSL in Python Clients


To use SSL with the Python client either:
  1. Use a URL of the form amqps://<host>:<port>, where host is the brokers hostname and port is the SSL port (usually 5671), or
  2. Set the 'transport' attribute of the connection to "ssl".
The Python client has some limitations in SSL functionality:
Server authentication must be demanded, and the client name must be explicitly provided when using the EXTERNAL SASL mechanism for authentication.
  • The Python clients has an optional parameter ssl_trustfile (see Python SSL Parameters). When this parameter is specified, trust store validation of the certificate is performed.
  • The Python client matches the server's SSL certificate against the connection hostname when the optional parameter ssl_trustfile is supplied.
  • When using the EXTERNAL SASL mechanism for authentication, you must provide the client name in the connection string. This client name provided in the connection string must match the identity of the SSL certificate. Missing either these two will cause the connection to fail: by not providing the client name in the connection string, or providing a client name that does match the identity of the SSL certificate.
Python SSL Parameters

The QPID Python client accepts the following SSL-related configuration parameters:

  • ssl_certfile - the path to a file that contains the PEM-formatted certificate used to identify the local side of the connection (the client). This is needed if the server requires client-side authentication.
  • ssl_keyfile - In some cases the client's private key is stored in the same file as the certificate (i.e. ssl_certfile). If the ssl_certfile does not contain the client's private key, this parameter must be set to the path to a file containing the private key in PEM file format.
  • ssl_skip_hostname_check - When set to true the connection hostname verification against the server certificate is skipped.
  • ssl_trustfile - this parameter contains a path to a PEM-formatted file containing a chain of trusted Certificate Authority (CA) certificates. These certificates are used to authenticate the remote server.
  • These parameters are passed as arguments to the qpid.Connection() object when it is constructed. For example:
    Connection("amqps://client@127.0.0.1:5671", ssl_certfile="/path/to/certfile", ssl_keyfile="/path/to/keyfile")
    Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat