aspnetcore
aspnetcore copied to clipboard
https error when using webapi with sdk dotnet 8.0.203 on a mac Sonoma 14.4 (x64)
Describe the bug
https error when using webapi with sdk dotnet 8.0.203 on a mac Sonoma 14.4 (x64)
I'm on a mac, Sonoma 14.4
I use the dotnet 8.0.203 SDK (x64)
When I create a webapi with dotnet new webapi -n MyApp
, I get the weatherforecast for free.
When I run the server, and run curl https://localhost:7067/weatherforecast
for the first time, I get the correct repsonse, no problems there.
However, when I run the same curl command a second time, it also returns the correct response, but the server outputs this:
fail: Microsoft.AspNetCore.Server.Kestrel[0]
Unhandled exception while processing 0HN2BATH5FO82.
System.IO.IOException: The encryption operation failed, see inner exception.
---> System.ComponentModel.Win32Exception (14): Bad address
...
...
<more stacktrace lines>
I already refreshed my local certificates with dotnet dev-certs -t, so that is no solution.
When I create the exact same app with dotnet 7.0.202, there is no problem.
To Reproduce
- Be on a mac with Sonoma 14.4 (x64) en have dotnet 8.0.203 SDK (x64) installed
- Create a vanilla new webapi app:
dotnet new webapi -n YourApp
- Make sure you have the dev certs installed and trusted
- Run the server with the https profile
dotnet run --launch-profile https
- Make a curl call to the the weahterforecast endpoint `curl https://localhost:<your-port-here>/weahterforecast
- You will get a successful response
- Execute the same curl command a second time
- Again, the you will get a successful response, but this time the webserver will throw aforementioned error:
System.IO.IOException: The encryption operation failed, see inner exception.
Further technical details
dotnet --info
.NET SDK: Version: 8.0.203 Commit: 5e1ceea679 Workload version: 8.0.200-manifests.4e94be9c
Runtime Environment: OS Name: Mac OS X OS Version: 14.4 OS Platform: Darwin RID: osx-x64 Base Path: /usr/local/share/dotnet/sdk/8.0.203/
.NET workloads installed: There are no installed workloads to display.
Host: Version: 8.0.3 Architecture: x64 Commit: 9f4b1f5d66
.NET SDKs installed: 6.0.407 [/usr/local/share/dotnet/sdk] 7.0.202 [/usr/local/share/dotnet/sdk] 8.0.201 [/usr/local/share/dotnet/sdk] 8.0.203 [/usr/local/share/dotnet/sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found: None
Environment variables: Not set
global.json file: Not found
IDE not relevant, since this is run from the command line