Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 442 forks source link

(Linux) System.Net.Http: Peer certificate cannot be authenticated with given CA certificates. #2863

Closed jacktho closed 6 years ago

jacktho commented 6 years ago

System.Private.CoreLib: An error occurred while sending the request. System.Net.Http: Peer certificate cannot be authenticated with given CA certificates.

Using the cosmosDB binding in Linux, I am unable to connect to a Cosmos DB emulator running on a networked Windows machine. This issue appears to be related to .NET Core and OpenSSL/*nix as Windows to Windows works fine for me after importing the public key into the Windows Certificate Store of the client computer running Azure Functions.

I am able to confirm the cert was properly imported into the Linux machine/OpenSSL as it is used by the emulator's browser based data explorer (the data explorer does not work without the cert installed).

Because the emulator only runs on Windows, this issue makes local development with Azure Functions and the emulator not possible outside of Windows.

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

  1. Install the emulator on Windows with networking enabled.
  2. Install Azure Functions Core Tools, the CosmosDB extension and dependencies on Linux
  3. Export/Import cert.
  4. Start function that requires connection to emulator.
  5. See error.

Expected behavior

Authentication should succeed using the imported certificate and a connection should be established.

Actual behavior

The above error is thrown.

Known workarounds

None.

Related information