In my current situation I am using the stomp.py library (http://jasonrbriggs.github.io/stomp.py/stomp.html#module-stomp.connect) to connect to an ActiveMQ instance on another server. I am on python 2.7 and the connection works just fine when no SSL is configured. I use provided connection method (1.2) to connect and provide the following parameters in addition to host and ports:
- ssl_key_file=ssl_key_file
- ssl_cert_file=ssl_cert_file
- ssl_version=ssl.PROTOCOL_TLSv1_2
- use_ssl=True
The key and cert files are text from said files which I got using the file open() method which seems to work fine.
I have tried among other options to also set the context in ssl.SSL_Context. I am quite sure the ActiveMQ uses SSL and has said protocol.
When I'm trying to connect using conn.start() I receive the following error:
File "/usr/local/lib/python2.7/dist-packages/stomp/transport.py", line 733, in attempt_connection
tls_context.load_cert_chain(certfile, keyfile, password)
IOError: [Errno 71] Protocol error
I am unable to find a working example on getting stomp.py to connect using SSL, so I cannot find a way to do this.
Is there anyone out there who has seen this before?