|
1 | 1 | # type: ignore
|
2 | 2 |
|
3 | 3 |
|
4 |
| -from rabbitmq_amqp_python_client import ( # SSlConfigurationContext, |
| 4 | +from rabbitmq_amqp_python_client import ( # SSlConfigurationContext,; SslConfigurationContext,; ClientCert, |
5 | 5 | AddressHelper,
|
6 | 6 | AMQPMessagingHandler,
|
7 | 7 | BindingSpecification,
|
|
10 | 10 | ExchangeSpecification,
|
11 | 11 | Message,
|
12 | 12 | QuorumQueueSpecification,
|
13 |
| - SSlConfigurationContext, |
14 | 13 | )
|
15 | 14 |
|
16 | 15 |
|
@@ -60,15 +59,18 @@ def on_link_closed(self, event: Event) -> None:
|
60 | 59 |
|
61 | 60 |
|
62 | 61 | def create_connection() -> Connection:
|
63 |
| - # connection = Connection("amqps://guest:guest@localhost:5672/") |
64 |
| - # in case of SSL |
65 |
| - ca_cert_file = ( |
66 |
| - "/Users/dpalaia/projects/rabbitmq-stream-go-client/.ci/certs/ca_certificate.pem" |
67 |
| - ) |
68 |
| - connection = Connection( |
69 |
| - "amqps://guest:guest@localhost:5671/", |
70 |
| - ssl_context=SSlConfigurationContext(ca_cert=ca_cert_file), |
71 |
| - ) |
| 62 | + connection = Connection("amqps://guest:guest@localhost:5672/") |
| 63 | + # in case of SSL enablement |
| 64 | + # ca_cert_file = ".ci/certs/ca_certificate.pem" |
| 65 | + # client_cert = ".ci/certs/client_certificate.pem" |
| 66 | + # client_key = ".ci/certs/client_key.pem" |
| 67 | + # connection = Connection( |
| 68 | + # "amqps://guest:guest@localhost:5671/", |
| 69 | + # ssl_context=SslConfigurationContext( |
| 70 | + # ca_cert=ca_cert_file, |
| 71 | + # client_cert=ClientCert(client_cert=client_cert, client_key=client_key), |
| 72 | + # ), |
| 73 | + # ) |
72 | 74 | connection.dial()
|
73 | 75 |
|
74 | 76 | return connection
|
|
0 commit comments