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 8291239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:03:42+00:00 2026-06-08T13:03:42+00:00

Possible Duplicate: How are SSL certificate server names resolved/Can I add alternative names using

  • 0

Possible Duplicate:
How are SSL certificate server names resolved/Can I add alternative names using keytool?

I created a certificate and set the CN to the IP address of my server which is in xxx.xxx.xxx.xxx format. But when I try to run my code in Java, I’m getting a HTTPS hostname wrong: should be <xxx.xxx.xxx.xx> error message.

What could be wrong? I’m sure that I’m connecting to the correct IP address. However, I did not specify the port of the server on the certificate. Is the port required when supplying the value for CN? But I’m using the default port for https which is 8443. Also, I tried changing my CN from the IP address of my server to “localhost”. It works after that. I’m thinking if the CN part does not accept an IP address as value?

Can you please explain how the CN works and what are the required value for it?

Thanks!

  • 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-08T13:03:45+00:00Added an answer on June 8, 2026 at 1:03 pm

    The identity you need to put in the certificate needs to be the one you’re looking for via the URL. For example, if you’re using https://www.example.net, your certificate needs to be valid for www.example.net; if you’re using https://10.0.0.1/, your certificate needs to be valid for 10.0.0.1.

    The Common Name RDN in the Subject DN of the certificate is normally only used when (a) there is no Subject Alternative Name DNS entry and (b) it’s looking for a host name, not an IP address. This is defined in RFC 2818 Section 3.1:

    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.

    […]

    In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must be present
    in the certificate and must exactly match the IP in the URI.

    In general, using IP address in certificates is not recommended (see problems mentioned in RFC 6125. However, if you really need to, you’ll need a certificate with the IP address is a SAN entry of IP address type, which you can generate as described in this answer.

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

Sidebar

Related Questions

Possible Duplicate: javax.net.ssl.SSLException: Not trusted server certificate I am trying to connect to server
Possible Duplicate: Using SSL in an iPhone App - Export Compliance I am in
Possible Duplicate: How to get a response from a https server using android sdk?
Possible Duplicate: How to make my site valid using SSL? As soon as my
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:
Possible Duplicate: Can main function call itself in C++? I found this problem very
Possible Duplicate: array_splice() for associative arrays How to add an array value to the
Possible Duplicate: How can I combine multiple rows into a comma-delimited list in Oracle?

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.