TLS for local development

I add a self-signed certificate to the nats and the resgate, but resgate writes to me “Failed to start server: x509: certificate signed by unknown authority.”
Tell me how you add certificates for local development.

Hi! And welcome to the forum! :partying_face:

Sorry for the delayed response. I missed to noticed that the Discourse forum had erroneously flagged your post as needing approval. Strange.

What did you do to get the error? I just tried with a self-signed cert (using this page as a reference on how to generate the cert), and it worked fine:

openssl genrsa -out server.key 2048
openssl ecparam -genkey -name secp384r1 -out server.key
openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
resgate --tls --tlscert server.crt --tlskey server.key

Or did you use the certificate on nats-server, so that you got the error when resgate tried to connect to NATS?

Maybe this page would help: NATS Docs - Enabling TLS

Best regards,