AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Is `HttpsInlineCertFile` usable? It hits `System.Net.Sockets.SocketException (13): Permission denied`

Open khteh opened this issue 7 months ago • 2 comments

Description

[04/21/2025 13:01:56 +08:00] Error { Id: 11, Name: "HostedServiceStartupFaulted" } IP: CorrelationId: Agent: ContentType: ContentLength: RequestBody: RequestQuery: MemoryUsage:/294653952 Hosting failed to start { SourceContext: "Microsoft.Extensions.Hosting.Internal.Host", ThreadId: 1, ExceptionDetail: [("Type": "System.Net.Sockets.SocketException"), ("HResult": -2147467259), ("Message": "Permission denied"), ("Source": "System.Net.Sockets"), ("TargetSite": "Void UpdateStatusAfterSocketErrorAndThrowException(System.Net.Sockets.SocketError, Boolean, System.String)"), ("SocketErrorCode": AccessDenied), ("SocketErrorCodeMessage": "An attempt was made to access a Socket in a way that is forbidden by its access permissions.")] } 
System.Net.Sockets.SocketException (13): Permission denied
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportOptions.CreateDefaultBoundListenSocket(EndPoint endpoint)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.<>c__DisplayClass28_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.AnyIPListenOptions.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.EndpointsStrategy.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__14_1(IHostedService service, CancellationToken token)
   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)

Only using "Https": { works. What's the difference between these 2 key names in the json configuration!?! [Enter feedback here]

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/servers/kestrel/endpoints.md

Document ID

fd9cc0c2-3ea3-f437-e0ac-8789fb96faf7

Platform Id

08b5cdab-b211-0993-3780-76cf77185dbc

Article author

@tdykstra

Metadata

  • ID: 312df0ba-e769-c904-40b2-733c291704a0
  • PlatformId: 08b5cdab-b211-0993-3780-76cf77185dbc
  • Service: aspnet-core
  • Sub-service: fundamentals

Related Issues

khteh avatar Apr 21 '25 05:04 khteh

Only using "Https": { works. What's the difference between these 2 key names in the json configuration!?! what 2 key names?

Why do you think HttpsInlineCertFile is throwing the exception?

Rick-Anderson avatar Apr 21 '25 17:04 Rick-Anderson

No idea. Why does https work perfectly but not this key name? What does this magic key name HttpsInlineCertFile do?

khteh avatar Apr 22 '25 01:04 khteh