diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs index e58c41c04e3a5e..7cd5123b7420e4 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs @@ -427,7 +427,7 @@ internal static unsafe void SslCtxSetAlpnProtos(SafeSslHandle ctx, List protocol = protocols.Slice(1, length); if (protocol.SequenceCompareTo(applicationProtcol.Protocol.Span) == 0) { - if (Interop.AppleCrypto.SslCtxSetAlpnProtocol(context.SslContext, applicationProtcol)) + int osStatus = Interop.AppleCrypto.SslCtxSetAlpnProtocol(context.SslContext, applicationProtcol); + if (osStatus == 0) { context.SelectedApplicationProtocol = applicationProtcol; + if (NetEventSource.Log.IsEnabled()) + NetEventSource.Info(context, $"Selected '{applicationProtcol}' ALPN"); + } + else + { + if (NetEventSource.Log.IsEnabled()) + NetEventSource.Error(context, $"Failed to set ALPN: {osStatus}"); } // We ignore failure and we will move on with ALPN