insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

`insomnia` request results in "Error: SSL peer..." | while copied `curl` (from insomnia) works

Open ghost opened this issue 4 years ago • 24 comments

Describe the bug Get the following error:

    "Error: SSL peer certificate or SSH remote key was not OK"

When making a request using insomnia while making the same request using curl works (the curl command was copied from insomnia)

To Reproduce Steps to reproduce the behavior:

  1. setup a get request in insomnia
  2. send the request
  3. returns an error "Error: SSL peer certificate or SSH remote key was not OK"
  4. right click on the request name (in the navigation panel)
  5. select "Copy as Curl"
  6. paste the curl command into the terminal and press enter
  7. observe the curl command succeeds as expected

Expected behavior Insomnia should be able to make the request as the curl command in the terminal

Screenshots (can't due to sensitive data)

Desktop (please complete the following information):

  • OS: macOS 10.15.5
  • Installation Method: directly from insomnia.rest
  • App Version Version 2020.2.2 (2020.2.2)

Additional context All other requests work as expected except to one service (specific internal at work) The Exact same request worked fine in the previous version of insomnia (can't remember the version number)

ghost avatar Jun 18 '20 18:06 ghost

Having this same problem. According to the log, Insomnia is no longer correctly using my system trusted roots:

* Preparing request to https://localhost:8080/graphql
* Using libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libidn2/2.1.1 libssh2/1.9.0 nghttp2/1.40.0
* Current time is 2020-06-26T01:02:18.443Z
* Disable timeout
* Enable automatic URL encoding
* Enable SSL validation
* Enable cookie sending with jar of 0 cookies
* Hostname in DNS cache was stale, zapped
*   Trying ::1:8080...
* Connection failed
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#4)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
*   CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Request CERT (13):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 4

This previously worked totally fine; not sure if it's that validation was added or insomnia support for keychain roots was broken in a recent version on OSX.

bmhatfield avatar Jun 26 '20 01:06 bmhatfield

Related: https://github.com/Kong/insomnia/issues/2255

bmhatfield avatar Jun 26 '20 01:06 bmhatfield

We're having same problem with a cert issued by internal issuer/authority. Downgrading to 7.1.1 fixed it. Both root and issuer certificate are trusted in macOS keychain.

designed4device avatar Jul 02 '20 01:07 designed4device

It's broken between 7.1.1 and 2020.2.0 ... presumably by #2223 but I haven't had time to dig in and see what exactly caused the breakage.

austin1howard avatar Jul 14 '20 17:07 austin1howard

FYI: Still broken in 2020.3.3

austin1howard avatar Jul 23 '20 05:07 austin1howard

Still broken in 2020.4.1

targetdrone avatar Sep 24 '20 17:09 targetdrone

I had this issue when using a new certificate from Let's Encrypt. I solved it by regenerating a proper certificate chain by using this very useful website: https://whatsmychaincert.com/

jjr52 avatar Sep 29 '20 15:09 jjr52

Just had this issue too. Yesterday it worked and today I get "Error: SSL peer certificate or SSH remote key was not OK" 2020.5.1

willemdh avatar Feb 23 '21 17:02 willemdh

I solved this by disabling certification validations in Insomnia Preferences. Just uncheck the Validate certificates option under Request / Response. I'm using version v2021.1.1

MarcosReis16 avatar Mar 25 '21 20:03 MarcosReis16

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 26 '21 23:05 stale[bot]

Still an active problem.

iandunn avatar May 27 '21 00:05 iandunn

Still a problem. As a workaround MarcosReis16 hint helped.

BSchuhmacher avatar Jun 16 '21 07:06 BSchuhmacher

i'm suggesting for you, follow this stepts:

if you using insomnia, go to Preferences -> General -> Response/Request. So, you can uncheck the box (like the image i uploaded).

image

rildomar avatar Aug 28 '21 14:08 rildomar

I wouldn't do that if you use authenticate on any endpoints (or might in the future); that's a huge security risk.

iandunn avatar Aug 30 '21 16:08 iandunn

Also having this issue. Identical sites in test and prod yield different results. Test works fine, but prod generates this error. Would like to see this fixed.

jarchercritigen avatar Sep 08 '21 14:09 jarchercritigen

i'm suggesting for you, follow this stepts:

if you using insomnia, go to Preferences -> General -> Response/Request. So, you can uncheck the box (like the image i uploaded).

image

It worked for me

agencia3w avatar Mar 09 '22 14:03 agencia3w

having the same issue with a valid certificate...

SergioSuarezDev avatar May 24 '22 20:05 SergioSuarezDev

I'm having this issue as well with a newly generated cert

JonahBranch avatar Sep 21 '22 06:09 JonahBranch

i'm suggesting for you, follow this stepts:

if you using insomnia, go to Preferences -> General -> Response/Request. So, you can uncheck the box (like the image i uploaded).

image

Its work for me!

SenaJp avatar Mar 24 '23 18:03 SenaJp

Why is everyone telling to disable Validate Certificates?

This is not fixing the problem, this is ignoring the problem. Why is it doing this in the first place?

I have a site behind nodejs proxy with a certificate that works everywhere except in Insomnia. Why it's not working there? There may be an issue in my cert setup or it may be insomnia that don't know how to validate certificates, how can i know which one it is?

This issue happens when using this in NodeJS, tls.createSecureContext(ssl_cert);

but it doesn't happen with if i create a regular https server, and the validation only fails in Insomnia not anywhere else (browser is fine).

Could it be the cypher? The TLS version? SSL engine? There is something wrong somewhere that i need figure out.

Marc477 avatar Apr 11 '23 22:04 Marc477

I am not seeing these settings in Preferences

image

yosiasz avatar Apr 25 '23 17:04 yosiasz

@yosiasz You need to scroll down in General. There you will find the Settings for Request/Response

meierhoeferjannis avatar Jun 22 '23 12:06 meierhoeferjannis

Is a fix for this coming? Nov 2023, and disabling security is an awful workaround.

bprimrose avatar Nov 13 '23 19:11 bprimrose