Badgerati / Pode

Pode is a Cross-Platform PowerShell web framework for creating REST APIs, Web Sites, and TCP/SMTP servers
https://badgerati.github.io/Pode
MIT License
866 stars 92 forks source link

Issue with `CreateSelfSigned` Certificate on macOS Sequoia #1425

Open mdaneri opened 1 month ago

mdaneri commented 1 month ago

Description:

When using a self-signed certificate with Pode on macOS Sequoia, applications that define an HTTPS endpoint via Add-PodeEndpoint -Protocol Https -SelfSigned encounter the following error:

Exception calling "CreateSelfSigned" with "2" argument(s): "The specified item is no longer valid. It may have been deleted from the keychain."

This issue affects any Pode application that uses HTTPS with a self-signed certificate on macOS Sequoia.

Environment:

Steps to Reproduce:

  1. Install Pode on macOS Sequoia.
  2. Create a basic Pode application with an HTTPS endpoint:
# Start the Pode server
Start-PodeServer {
    Add-PodeEndpoint -Protocol Https -SelfSigned -Address localhost -Port 443
}
  1. Run the application.

Expected Result:

The Pode application should start successfully with the self-signed certificate for the HTTPS endpoint.

Actual Result:

An exception is thrown:

Exception calling "CreateSelfSigned" with "2" argument(s): "The specified item is no longer valid. It may have been deleted from the keychain."

Additional Information:

The issue is related to the .NET runtime on macOS and has been identified as a .NET issue. You can track the .NET issue here: https://github.com/dotnet/runtime/issues/106775.