pulsar-client-php icon indicating copy to clipboard operation
pulsar-client-php copied to clipboard

TLS options

Open jusstinas opened this issue 1 year ago • 6 comments

At the moment if DSN is pulsar+ssl:// or https:// TLS options for consumer is mandatory and without them consumer throwing exception even in general connection is possible without certs. Can TLS config/usage be optional?

jusstinas avatar Jul 17 '24 12:07 jusstinas

@jusstinas If it's pulsar:// or http:// TLS options not required

ikilobyte avatar Jul 17 '24 13:07 ikilobyte

@ikilobyte Let's say I have outside test Pulsar cluster, which accepts only https connections. I need to configure consumer url as pulsar+ssl or https:// and then TLS options are required. But in general it's possible to connect pulsar without certs and it's forced to do only by client. For example it's not mandatory in nodejs client and I guess in other clients also.

jusstinas avatar Jul 17 '24 13:07 jusstinas

I need to find some information and will add this feature in the next version (if possible).

ikilobyte avatar Jul 18 '24 01:07 ikilobyte

@jusstinas

Hi, I modified the latest code in the main subsection, since I don't have your kind of requirement, so I need your help to test it, please update to the latest code

composer require ikilobyte/pulsar-client-php:dev-main
$options = new \Pulsar/ConsumerOptions();
$tls = new \Pulsar\TLSOptions('','');
$options->setTLS($tls);

...

I'll release a new version immediately if it meets your needs, thanks!

ikilobyte avatar Jul 21 '24 08:07 ikilobyte

@ikilobyte With those changes it's possible to connect without actual TLS config. Thank you!

jusstinas avatar Jul 22 '24 07:07 jusstinas

@jusstinas v1.3.3 release

ikilobyte avatar Jul 22 '24 13:07 ikilobyte