Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTPS error with self-signed cert #1411

Closed
DanGough opened this issue Oct 10, 2024 · 1 comment · Fixed by #1440
Closed

HTTPS error with self-signed cert #1411

DanGough opened this issue Oct 10, 2024 · 1 comment · Fixed by #1440
Assignees
Labels
Milestone

Comments

@DanGough
Copy link

Describe the Bug

I am getting this error on every page load when using HTTPS with a self-signed cert:

[Error] AuthenticationException: Authentication failed, see inner exception.
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)
   at Pode.PodeRequest.UpgradeToSSL(CancellationToken cancellationToken) in C:\Projects\pode-builds\2.11.0\src\Listener\PodeRequest.cs:line 109
[Error] Win32Exception: An unknown error occurred while processing the certificate.

Steps To Reproduce

Run this and load the page:

#Requires -Modules @{ModuleName='Pode'; ModuleVersion='2.11.0'}
#Requires -Modules @{ModuleName='Pode.Web'; ModuleVersion='0.8.3'; MaximumVersion='0.8.3'}

Start-PodeServer {
    New-PodeLoggingMethod -Terminal | Enable-PodeErrorLogging -Levels Error, Warning, Informational #, Verbose
    Add-PodeEndpoint -Hostname 'localhost' -Protocol 'HTTPS' -Port 443 -SelfSigned       
    Use-PodeWebTemplates -Title 'Test'
    Add-PodeWebPage -Name 'Test' -ScriptBlock {
        New-PodeWebContainer -Content @(
            New-PodeWebQuote -Value 'Pode is awesome!' -Source 'Badgerati'
        )
    }
}

Expected Behavior

Page should load without error, as it does with Pode 2.10.0.

Platform

  • OS: Windows 11
  • Browser: Edge
  • Versions:
    • Pode: 2.11.0
    • Pode.Web 0.8.3
    • PowerShell: 7.4.5
@Badgerati
Copy link
Owner

I've been able to reproduce the issue, and it's actually an "OK" error - caused by browsers not initially trusting localhost self-signed certs - but is now being displayed because of logging changes made in 2.11.0.

I've done some work to refactor how the logging and exceptions get thrown, and this "error" is now kept silent - unless Debug logging is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants