Skip to content

SSL Setup

BraveSirRobin edited this page May 24, 2011 · 3 revisions

SSL Configuration

Amqphp supports SSL with client certificates and peer verification via. the PHP streams API (http://www.php.net/streams). This means that you have to use the StreamSocket socket handler, you do this by passing the correct parameters to the Connection constructor. If you have to set up your own SSL certificates, follow the guide on the RabbitMQ site (http://www.rabbitmq.com/ssl.html), then you need to set up the certificates for PHP:

# For the client cert
cat client/key.pem > phpcert.pem
cat client/cert.pem >> phpcert.pem
cat testca/cacert.pem >> phpcert.pem

# For the Server cert
server/key.pem > php-server-cert.pem
server/cert.pem >> php-server-cert.pem
testca/cacert.pem >> php-server-cert.pem

Now, you need to tell RabbitMQ where the certificates live, you do this by passing an associative array structure in to the constructor. For more info, check the forker.xml config file in the test directory - this data is converted directly in to the required array structure.

Clone this wiki locally