Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7735473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:30:39+00:00 2026-06-01T07:30:39+00:00

While accessing our own website in Java code, an exception is thrown: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException:

  • 0

While accessing our own website in Java code, an exception is thrown:

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching en.greatfire.org found.

However, when accessing it in a browser or using curl, there’s no problem.

Any idea why this could be? If there’s any problem with our certificates but browsers are somehow more lenient we’d like to fix it.

Not sure if it’s related, we have separate certificates for greatfire.org and en.greatfire.org.

Java code that throws the above exception:

    URL url = new URL("https://en.greatfire.org");
    HttpURLConnection conn = (HttpURLConnection)url.openConnection();
    System.out.println("Response code: " + conn.getResponseCode());
    for(Entry<String, List<String>> header : conn.getHeaderFields().entrySet()) {
        for(String headerValue : header.getValue()) {
            System.out.println(header.getKey() + ": " + headerValue);
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:30:40+00:00Added an answer on June 1, 2026 at 7:30 am

    RFC 2818 (the HTTPS specification) says:

    If a subjectAltName extension of type dNSName is present, that MUST
    be used as the identity. Otherwise, the (most specific) Common Name
    field in the Subject field of the certificate MUST be used. Although
    the use of the Common Name is existing practice, it is deprecated and
    Certification Authorities are encouraged to use the dNSName instead.

    Essentially, if there’s in no SAN extension at all, it should use the CN in the Subject DN, otherwise, it should only use the SAN entries. (The more recent RFC 6125 also goes along these lines.)

    It sounds like your certificate has one or more SAN entries, but none of them are valid for the host name you’re after (which could be in the CN only).

    Java is quite strict on this, including on the type of SAN entry (e.g. for IP addresses), but some browsers are more lenient. I’d suggest fixing the certificate by putting all the host names (or IP addresses) you want to use in Subject Alternative Names.

    EDIT:

    This being said, you have a couple of related problems.

    The certificate you serve for en.greatfire.org has SAN entries for both en.greatfire.org and www.en.greatfire.org, which is fine and should work.

    However, if you’re using a client that doesn’t support the SSL/TLS Server Name Indication extension (e.g. openssl s_client -showcerts -connect en.greatfire.org:443, or Java 6 for that matter), you get a certificate for greatfire.org and www.greatfire.org.

    This is a double problem because:

    • You’ve configured SNI on your browser, which is not supported by Java 6, any version of IE on XP or Android under version 3.0 (and perhaps a few others).
    • greatfire.org doesn’t even resolve to that same machine.

    It looks like one of your certificates is fine, but clients that don’t support SNI won’t get to see it.
    If you want to avoid this problem, get a certificate valid for all 4 names (4 SAN entries), and point greatfire.org to the right IP address too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We found a problem while accessing the Web service from our ASP.Net MVC project
I am getting this exception while accessing the jax-ws web service from my client.
So currently in our code, we have a bunch of classes around accessing roles
I am getting an error while accessing the core service on SDL Tridion 2011
I am trying to integrate saleforce with my project. While accessing the url /chatter/feeds/files/me
While my ASP.NET project uses version 3.5 of the framework , the event log
Hey guys, here is my code. int main() { char buffer[BUFSIZE]; // define our
After adding Auth component while accessing the home page it redirects to login page
I have following kind of index while accessing json data using jquery data.rows[0].student_1 data.rows[0].student_2
I am getting this parser error while accessing the server url Parser Error :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.