Need help on SOLCLIENT_SUBCODE_COMMUNICATION_ERROR

argoran
argoran Member Posts: 6

Hi,

I am encountering an error when trying to establish a connection to the broker. I'm using TLS with certificate in the transport security strategy. Here is my code:

transport_security = TLS.create() \
            .with_certificate_validation(True, validate_server_name=True,
                                            trust_store_file_path=trust_store_path)

messaging_service = MessagingService.builder() \
            .from_properties(broker_props) \
            .with_transport_security_strategy(transport_security) \
            .build()
messaging_service.connect()

Here is the error:

2021-09-15 11:55:42,055 - INFO - solace_app - __main__.py - main - Connecting to broker...
2021-09-15 11:56:00,783 [WARNING] solace.messaging.core: [_solace_session.py:914]  [[SERVICE: 0x11008f898] - [APP ID: app_50275e0b-fefc-4488-ae1d-69bb1a9c0498]] {'caller_description': 'From service event callback', 'return_code': 'Ok', 'sub_code': 'SOLCLIENT_SUBCODE_COMMUNICATION_ERROR', 'error_info_sub_code': 14, 'error_info_contents': "SSL 'SSL-client' cannot read, sslErr = 6: 'OpenSSL Error"}
2021-09-15 11:56:00,784 [WARNING] solace.messaging.core: [_solace_session.py:822]  [[SERVICE: 0x11008f898] - [APP ID: app_50275e0b-fefc-4488-ae1d-69bb1a9c0498]] {'caller_description': 'do_connect', 'return_code': 'Not ready', 'sub_code': 'SOLCLIENT_SUBCODE_COMMUNICATION_ERROR', 'error_info_sub_code': 14, 'error_info_contents': "SSL 'SSL-client' cannot read, sslErr = 6: 'OpenSSL Error"}

What does it means if the return_code is not Not Ready and error_info_contents is SSL 'SSL-client' cannot read, sslErr = 6: 'OpenSSL Error

Best Answer

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 538 admin
    #2 Answer ✓

    hey @argoran ! were you able to connect to the broker after? In python, there are multiple ways you can configure the connection
    1. At messaging service build time (like what you did in the code snippet above). This is called a TLS strategy implementation
    2. In the service properties configuration (i.e. broker_props) by having a "solace.messaging.tls.trust-store-path": "<path_to_cert_file>"

Answers

  • argoran
    argoran Member Posts: 6

    Nevermind it seems that there that the broker that I am trying to connect is preventing my connection.

  • Tamimi
    Tamimi Member, Administrator, Employee Posts: 538 admin
    #4 Answer ✓

    hey @argoran ! were you able to connect to the broker after? In python, there are multiple ways you can configure the connection
    1. At messaging service build time (like what you did in the code snippet above). This is called a TLS strategy implementation
    2. In the service properties configuration (i.e. broker_props) by having a "solace.messaging.tls.trust-store-path": "<path_to_cert_file>"

  • argoran
    argoran Member Posts: 6

    Hi @Tamimi, yes I was able to determine the issue. It was on the broker side. So I have used sdkperf for java to test the connection to the broker. There the error is much more helpful as it says "Error communicating with the router". This is now resolved.
    Thanks.