René's URL Explorer Experiment


Title: Microsoft GovCloud fails HostnameUtil.checkHostname · Issue #1202 · bcgit/bc-java · GitHub

Open Graph Title: Microsoft GovCloud fails HostnameUtil.checkHostname · Issue #1202 · bcgit/bc-java

X Title: Microsoft GovCloud fails HostnameUtil.checkHostname · Issue #1202 · bcgit/bc-java

Description: Code: `import java.net.URL; import java.io.InputStream; public class BCExample { public static void main(String[] args){ if (args.length != 1) { System.out.println("Usage: "+BCExample.class.getName()+" "); System.out.println("Examp...

Open Graph Description: Code: `import java.net.URL; import java.io.InputStream; public class BCExample { public static void main(String[] args){ if (args.length != 1) { System.out.println("Usage: "+BCExample.class.getName...

X Description: Code: `import java.net.URL; import java.io.InputStream; public class BCExample { public static void main(String[] args){ if (args.length != 1) { System.out.println("Usage: "+BCExample.cla...

Opengraph URL: https://github.com/bcgit/bc-java/issues/1202

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Microsoft GovCloud fails HostnameUtil.checkHostname","articleBody":"**Code:** \r\n`import java.net.URL;   \r\nimport java.io.InputStream;\r\n\r\npublic class BCExample {   \r\n    public static void main(String[] args){\r\n\r\n        if (args.length != 1) {\r\n            System.out.println(\"Usage: \"+BCExample.class.getName()+\" \u003cURL> \");\r\n            System.out.println(\"Example: java -Djdk.tls.trustNameService=true BCExample https://login.microsoftonline.us\");\r\n            System.exit(1);\r\n        }\r\n\r\n        try{    \r\n            InputStream response =new URL(args[0]).openStream();    \r\n        }  \r\n        catch(Exception e){  \r\n            System.out.println(e);\r\n        }\r\n    }    \r\n}  `\r\n\r\n**Problem**\r\nUsing BC we found the following situation when we try to go against https://login.microsoftonline.us\r\n\r\norg.bouncycastle.tls.TlsFatalAlert: certificate_unknown(46)\r\n\tat org.bouncycastle.jsse.provider.ProvSSLSocketDirect.checkServerTrusted(ProvSSLSocketDirect.java:135)\r\n\tat org.bouncycastle.jsse.provider.ProvTlsClient$1.notifyServerCertificate(ProvTlsClient.java:360)\r\n\tat org.bouncycastle.tls.TlsUtils.processServerCertificate(TlsUtils.java:4889)\r\n\tat org.bouncycastle.tls.TlsClientProtocol.handleServerCertificate(TlsClientProtocol.java:788)\r\n\tat org.bouncycastle.tls.TlsClientProtocol.handleHandshakeMessage(TlsClientProtocol.java:671)\r\n\tat org.bouncycastle.tls.TlsProtocol.processHandshakeQueue(TlsProtocol.java:708)\r\n\tat org.bouncycastle.tls.TlsProtocol.processRecord(TlsProtocol.java:584)\r\n\tat org.bouncycastle.tls.RecordStream.readRecord(RecordStream.java:245)\r\n\tat org.bouncycastle.tls.TlsProtocol.safeReadRecord(TlsProtocol.java:856)\r\n\tat org.bouncycastle.tls.TlsProtocol.blockForHandshake(TlsProtocol.java:417)\r\n\tat org.bouncycastle.tls.TlsClientProtocol.connect(TlsClientProtocol.java:88)\r\n\tat org.bouncycastle.jsse.provider.ProvSSLSocketDirect.startHandshake(ProvSSLSocketDirect.java:445)\r\n\tat org.bouncycastle.jsse.provider.ProvSSLSocketDirect.startHandshake(ProvSSLSocketDirect.java:426)\r\n\tat sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)\r\n\tat sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:197)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)\r\n\tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)\r\n\tat sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)\r\n\tat java.net.URL.openStream(URL.java:1068)\r\n\tat BCExample.main(BCExample.java:14)\r\nCaused by: java.security.cert.CertificateException: No subject alternative name found matching domain name login.microsoftonline.us\r\n\tat org.bouncycastle.jsse.provider.HostnameUtil.checkHostname(HostnameUtil.java:97)\r\n\tat org.bouncycastle.jsse.provider.ProvX509TrustManager.checkEndpointID(ProvX509TrustManager.java:334)\r\n\tat org.bouncycastle.jsse.provider.ProvX509TrustManager.checkEndpointID(ProvX509TrustManager.java:453)\r\n\tat org.bouncycastle.jsse.provider.ProvX509TrustManager.checkExtendedTrust(ProvX509TrustManager.java:362)\r\n\tat org.bouncycastle.jsse.provider.ProvX509TrustManager.checkTrusted(ProvX509TrustManager.java:275)\r\n\tat org.bouncycastle.jsse.provider.ProvX509TrustManager.checkServerTrusted(ProvX509TrustManager.java:182)\r\n\tat org.bouncycastle.jsse.provider.ProvSSLSocketDirect.checkServerTrusted(ProvSSLSocketDirect.java:131)\r\n\t... 19 more\r\n\r\nThis works if we try it with https://login.microsoftonline.com and we found that BC always try to match hostname in the URL with 2nd entry in \"SubjectAlternativeName/DNSName\" in the certificate.\r\n\r\n1. [login.microsoftonline.us](https://login.microsoftonline.us/)\r\n\r\n    SubjectAlternativeName [\r\n     DNSName: [login.microsoftonline.us](https://login.microsoftonline.us/)\r\n     DNSName: [certauth.login.microsoftonline.us](https://certauth.login.microsoftonline.us/)\r\n     DNSName: [device.login.microsoftonline.us](https://device.login.microsoftonline.us/)\r\n     DNSName: [logincert.microsoftonline.us](https://logincert.microsoftonline.us/)\r\n    ]\r\n\r\n 2. [login.microsoftonline.com](https://login.microsoftonline.com/)\r\n     SubjectAlternativeName [\r\n     DNSName: [stamp2.login.microsoftonline.com](https://stamp2.login.microsoftonline.com/)\r\n     DNSName: [login.microsoftonline-int.com](https://login.microsoftonline-int.com/)\r\n     DNSName: [login.microsoftonline-p.com](https://login.microsoftonline-p.com/)\r\n     DNSName: [login.microsoftonline.com](https://login.microsoftonline.com/)\r\n     DNSName: [login2.microsoftonline-int.com](https://login2.microsoftonline-int.com/)\r\n     DNSName: [login2.microsoftonline.com](https://login2.microsoftonline.com/)\r\n     DNSName: [loginex.microsoftonline-int.com](https://loginex.microsoftonline-int.com/)\r\n     DNSName: [loginex.microsoftonline.com](https://loginex.microsoftonline.com/)\r\n     DNSName: [stamp2.login.microsoftonline-int.com](https://stamp2.login.microsoftonline-int.com/)\r\n    ]\r\n\r\nHow we can see the 2nd entry in https://login.microsoftonline.us/ has certauth and it doesn’t match, but in https://login.microsoftonline.com/ the 2nd entry has login and in this case works.\r\n\r\n**Step to reproduce**\r\n1. Generate the app with the code shared\r\n2. Configure BC in your environment \r\n3. Run the following command /DIRECTORY-OF-YOUR-APP/java -Djdk.tls.trustNameService=true BCExample https://login.microsoftonline.us","author":{"url":"https://github.com/gdovalMule","@type":"Person","name":"gdovalMule"},"datePublished":"2022-08-05T18:26:51Z","url":"https://github.com/bcgit/bc-java/issues/1202"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c9871ca0-857d-1f51-3db5-2ceb65cb7115
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC02C:1566C6:1D971A:28A81E:6AFBFFA2
html-safe-nonce46632f5ffd7ddf081a35ab70a1b48aa44a2f389e3be82f22c8e1e9d29bca0c7e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDJDOjE1NjZDNjoxRDk3MUE6MjhBODFFOjZBRkJGRkEyIiwidmlzaXRvcl9pZCI6IjU2NTQxNjk2Nzc4MzIzODg1MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac69bcfc115391b83fedf647d884e8751f9cbd5fbcb2fe65ac8964f9abde59a739
hovercard-subject-tagissue:1330246204
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bcgit/bc-java/1202/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bd757a06ecece3e1b8a3825297c861b200fb3876626c12f891f51cc1a24d06b8/bcgit/bc-java/issues/1202
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bd757a06ecece3e1b8a3825297c861b200fb3876626c12f891f51cc1a24d06b8/bcgit/bc-java/issues/1202
og:image:altCode: `import java.net.URL; import java.io.InputStream; public class BCExample { public static void main(String[] args){ if (args.length != 1) { System.out.println("Usage: "+BCExample.class.getName...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegdovalMule
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
turbo-cache-controlno-preview
go-importgithub.com/bcgit/bc-java git https://github.com/bcgit/bc-java.git
octolytics-dimension-user_id4566970
octolytics-dimension-user_loginbcgit
octolytics-dimension-repository_id10416648
octolytics-dimension-repository_nwobcgit/bc-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id10416648
octolytics-dimension-repository_network_root_nwobcgit/bc-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/bcgit/bc-java/issues/1202#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F1202
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F1202
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=bcgit%2Fbc-java
Reloadhttps://github.com/bcgit/bc-java/issues/1202
Reloadhttps://github.com/bcgit/bc-java/issues/1202
Reloadhttps://github.com/bcgit/bc-java/issues/1202
bcgithttps://github.com/bcgit
bc-javahttps://github.com/bcgit/bc-java
Codehttps://github.com/bcgit/bc-java
Issues47 (47)https://github.com/bcgit/bc-java/issues
Pull requests18 (18)https://github.com/bcgit/bc-java/pulls
Discussionshttps://github.com/bcgit/bc-java/discussions
Actionshttps://github.com/bcgit/bc-java/actions
Projectshttps://github.com/bcgit/bc-java/projects
Wikihttps://github.com/bcgit/bc-java/wiki
Security and qualityhttps://github.com/bcgit/bc-java/security
Insightshttps://github.com/bcgit/bc-java/pulse
https://github.com/bcgit/bc-java
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/1202
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/1202
Microsoft GovCloud fails HostnameUtil.checkHostnamehttps://github.com/bcgit/bc-java/issues/1202#top
https://github.com/peterdettman
https://github.com/gdovalMule
gdovalMulehttps://github.com/gdovalMule
on Aug 5, 2022https://github.com/bcgit/bc-java/issues/1202#issue-1330246204
https://login.microsoftonline.ushttps://login.microsoftonline.us
https://login.microsoftonline.comhttps://login.microsoftonline.com
login.microsoftonline.ushttps://login.microsoftonline.us/
login.microsoftonline.ushttps://login.microsoftonline.us/
certauth.login.microsoftonline.ushttps://certauth.login.microsoftonline.us/
device.login.microsoftonline.ushttps://device.login.microsoftonline.us/
logincert.microsoftonline.ushttps://logincert.microsoftonline.us/
login.microsoftonline.comhttps://login.microsoftonline.com/
stamp2.login.microsoftonline.comhttps://stamp2.login.microsoftonline.com/
login.microsoftonline-int.comhttps://login.microsoftonline-int.com/
login.microsoftonline-p.comhttps://login.microsoftonline-p.com/
login.microsoftonline.comhttps://login.microsoftonline.com/
login2.microsoftonline-int.comhttps://login2.microsoftonline-int.com/
login2.microsoftonline.comhttps://login2.microsoftonline.com/
loginex.microsoftonline-int.comhttps://loginex.microsoftonline-int.com/
loginex.microsoftonline.comhttps://loginex.microsoftonline.com/
stamp2.login.microsoftonline-int.comhttps://stamp2.login.microsoftonline-int.com/
https://login.microsoftonline.us/https://login.microsoftonline.us/
https://login.microsoftonline.com/https://login.microsoftonline.com/
https://login.microsoftonline.ushttps://login.microsoftonline.us
peterdettmanhttps://github.com/peterdettman
on Aug 11, 2022https://github.com/bcgit/bc-java/issues/1202#event-7168636185
https://github.com/peterdettman
peterdettmanhttps://github.com/peterdettman
on Aug 11, 2022https://github.com/bcgit/bc-java/issues/1202#issuecomment-1211570775
#660https://github.com/bcgit/bc-java/issues/660
https://login.microsoftonline.ushttps://login.microsoftonline.us
https://github.com/dghgit
dghgithttps://github.com/dghgit
on Sep 25, 2022https://github.com/bcgit/bc-java/issues/1202#issuecomment-1257094822
dghgithttps://github.com/dghgit
completedhttps://github.com/bcgit/bc-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 25, 2022https://github.com/bcgit/bc-java/issues/1202#event-7452790263
https://github.com/timriker
timrikerhttps://github.com/timriker
on Feb 23, 2023https://github.com/bcgit/bc-java/issues/1202#issuecomment-1442405070
https://github.com/dghgit
dghgithttps://github.com/dghgit
on Feb 24, 2023https://github.com/bcgit/bc-java/issues/1202#issuecomment-1442692283
https://github.com/timriker
timrikerhttps://github.com/timriker
on Feb 24, 2023https://github.com/bcgit/bc-java/issues/1202#issuecomment-1442835162
https://github.com/peterdettman
peterdettmanhttps://github.com/peterdettman
on Feb 24, 2023https://github.com/bcgit/bc-java/issues/1202#issuecomment-1442877192
Sign up for freehttps://github.com/signup?return_to=https://github.com/bcgit/bc-java/issues/1202
Sign in to commenthttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/1202
peterdettmanhttps://github.com/peterdettman
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.