Open josecelano opened 9 years ago
This is likely a mismatch between the given hostname and the hostname in the cert, this changed by php5.5. or php5.6 to be a strict match
Thanks @monofone, I´m using PHP 5.4.24 but I'm going to continue on the way you told me.
I have found these tutorials:
I still does not manage to connect using SSL.
I have seen you use fsockopen function and PHP manual says that function does not allow to provide stream context. stream_socket_client function allows to provide such context. Then, it seems I can not connect using SSL using your class. I have also seen in your functional test:
https://github.com/dejanb/stomp-php/blob/master/tests/functional/StompSslTest.php
that you do not use any context parameters like client certificate.
I want to use some context options like these:
$opts = array(
'ssl' => array(
'local_cert' => $localCertPath,
'cafile' => $cafilePath,
'verify_peer' => true,
'CN_match' => 'My Name',
'allow_self_signed' => true,
'disable_compression' => true,
'SNI_enabled' => true,
'passphrase' => 'xxxxxxxx',
'capture_peer_cert_chain' => true,
'capture_peer_cert' => true,
)
);
$context = stream_context_create($opts);
I have found the problem. The problem is just what I told before. Now I am using a fork of this repo and works fine.
This fork fixs the problem: https://github.com/rethab/stomp-php
That fork uses stream_socket_client functions instead of fsockopen.
It still seems to be impossible to connect over ssl. I keep getting Connection refused.
I am trying to connect to stomp over ssl and I get this error
My sample:
And my activemq.xml config file:
Server is up and accepting stomp connections.
This is the ActiveMQ guide to use stomp+ssl http://activemq.apache.org/how-do-i-use-ssl.html
I suppose:
Does somebody knows any good step by step tutorial/sample code?