darrenburns / posting

The modern API client that lives in your terminal.
Apache License 2.0
4.48k stars 64 forks source link

Support for dev certificates #41

Closed Persi closed 1 month ago

Persi commented 1 month ago

In our local dev environment we use self signed certs generated with mkcert. I do not want to disable ssl verification, but wasn't able to find a way to let posting use my local root CA generated by mkcert. I've tried injection python package "truststore" to posting as well as setting python config param global.cert.

Every request to my local backend fails with the following: Bildschirmfoto 2024-07-16 um 08 36 15

Did I miss something or does posting not support adding a CA for SSL verification currently?

darrenburns commented 1 month ago

Ah sorry, it's not supported yet. Hopefully it'll land this week.

Persi commented 1 month ago

Thanks for the response, no pressure, it's just good to know you have it on the roadmap!

darrenburns commented 1 month ago

This is included as part of 1.4.0 - let me know how it goes!

https://github.com/darrenburns/posting/releases/tag/1.4.0

I'll close this issue. Feel free to open a bug report if you run into any problems :)

Persi commented 1 month ago

Hi, I've upgraded to 1.5.1 and configured the new ssl options as follows:

ssl:
  certificate_path: '/Users/mberndt/.ceres/certs/localhost.data-experts.net.pem'
  key_file: '/Users/mberndt/.ceres/certs/localhost.data-experts.net.key'

Requests still fail with mentioned error if I enable certificate verification.

I wasn't sure about the password param, which password would be needed here?

darrenburns commented 1 month ago

My apologies - I see the mistake. I'll try to get a fix out today!

Persi commented 1 month ago

Everything is fine, thank you for your fast support! :)

darrenburns commented 1 month ago

There's a new ssl.ca_bundle config in 1.6.0 that'll let you specify a custom CA bundle. You can pass your dev certificate .pem to that. The key_file and certificate_path aren't required. Hopefully that resolves it 🙏

Persi commented 1 month ago

That new config works as expected :) Thank you very much for the fast fixes!

darrenburns commented 1 month ago

Great! Thank you for the feedback 🙇‍♂️