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 request timeouts when Pode is running on PS 7.4 #1291

Open
jfromh opened this issue May 2, 2024 · 2 comments
Open

HTTPS request timeouts when Pode is running on PS 7.4 #1291

jfromh opened this issue May 2, 2024 · 2 comments
Labels

Comments

@jfromh
Copy link

jfromh commented May 2, 2024

Describe the Bug

I'm having an issue with Invoke-WebRequest/Invoke-RestMethod timeouts using SSL when Pode is running on PowerShell 7.4 but not 7.2. This is similar to #977 but this seems to be a server-side issue. On the client side, I have tried 7.2 and 7.4 but it doesn't seem to matter, and the browser doesn't seem to be affected by this.

Steps To Reproduce

Server:

Start-PodeServer {
    New-PodeLoggingMethod | Enable-PodeErrorLogging -Level 'Error', 'Debug', 'Verbose'

    Add-PodeEndpoint -Name 'HTTPS' -Address '*' -Protocol 'HTTPS' -Port 443 -CertificateStoreName 'My' -CertificateStoreLocation 'LocalMachine' -CertificateThumbprint $Thumbprint

    Add-PodeRoute -Method 'GET' -Path '/test' -ScriptBlock {
        Write-PodeTextResponse -Value (Get-Date)
    }
}

Client:

While ($True) {
    (Invoke-WebRequest -Method 'GET' -Uri $URI -TimeoutSec 1).Content; Start-Sleep -Seconds 1
}

Expected Behavior

When Pode is running on 7.2 I get an updated timestamp every second.
When Pode is running on 7.4 I get mostly timeouts with random successful timestamps in between.

Platform

  • OS: Windows
  • Browser: Chrome
  • Versions:
    • Pode: 2.10.0
    • PowerShell: 7.4.2
@jfromh jfromh added the bug 🐛 label May 2, 2024
@mdaneri
Copy link
Contributor

mdaneri commented May 3, 2024

It's not a Pode issue but an Invoke-WebRequest one
try with curl.exe, and will work
Check this pester code https://github.com/Badgerati/Pode/blob/develop/tests/integration/RestApi.Https.Tests.ps1
we have exactly the same issue

@jfromh
Copy link
Author

jfromh commented May 3, 2024

I've come across the Invoke-WebRequest issues in other projects with PS5.1 but this problem only shows up when the Pode server is running on PS7.4. When running on PS7.2 I get no timeouts with Invoke-WebRequest.

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

No branches or pull requests

2 participants