alexrainman / ModernHttpClient

ModernHttpClient
MIT License
126 stars 27 forks source link

Hostname not verified exception (Utility.MatchHostnameToPattern not applied for certificate alt names) #41

Closed Logan2014 closed 4 years ago

Logan2014 commented 4 years ago

After I update NuGet package from 2.7.2 to 3.3.4 version I got "Hostname prod-25.westeurope.logic.azure.com not verified exception". For one of my endpoints.

I made some investigation on this issue. The problem is in method that verify hostname :) Server certificate contains subjectCn=westeurope.logic.azure.com and subjectAltNames=[westeurope.logic.azure.com, *.westeurope.logic.azure.com]. Method which check hostname uses Utility.MatchHostnameToPattern method to verify subjectCn name and simple Contains method for string array to check subjectAltNames. None of this verifications allow to use prod-25.westeurope.logic.azure.com hostname.

Resolution for this issue is application of MatchHostnameToPattern method for each subject alt name.

codingJWilliams commented 4 years ago

Can reproduce - having this issue too.

codingJWilliams commented 4 years ago

Hello,

May I ask why this was closed? Has a fix been made?

On Tue, Sep 17, 2019 at 4:52 PM Alexander Reyes notifications@github.com wrote:

Closed #41 https://github.com/alexrainman/ModernHttpClient/issues/41.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alexrainman/ModernHttpClient/issues/41?email_source=notifications&email_token=ADXD7H4YPGPWUY7W4FL2TNTQKD4MBA5CNFSM4IGBZNR2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOTVQ3KBA#event-2640426244, or mute the thread https://github.com/notifications/unsubscribe-auth/ADXD7H4XZMYFGSKRX5JCRPTQKD4MBANCNFSM4IGBZNRQ .

-- Best Regards, Jay Williams