Rust

Call unauthorized SSL request in Rust

It took me around 4 hours straight to resolve this issue, so I thought it might help someone in need.

Photo by Nicolas Corta Avila on Unsplash

Reqwest is a popular library for calling HTTP requests in Rust. It integrates with tokio run time. But if you’re in the case your HTTPs request does not have SSL certificate, then you cannot call the regular HTTP request like:

Calling this will throw SSL certificate error.

Instead you should use a client call with danger_accept_invalid_certs. Remember this will introduce security issue to man in the middle, so use it wisely.

Then you’re good to go.

Hope this helps guys & gals.

~~~PEACE~~~

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store