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

  • Home
  • SEARCH
  • 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 8006179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:25:35+00:00 2026-06-04T17:25:35+00:00

I have a 2 way SSL client and server written in java. Problem is

  • 0

I have a 2 way SSL client and server written in java. Problem is my server needs to be able to find out the hostname of the client and that client is located behind a NAT gateway or proxy. I have tried:
clientSocket.getRemoteSocketAddress(),
clientSocket.getInetAddress().getCanonicalHostName(),
clientSocket.getInetAddress().getHostAddress(),

whereby clientSocket is of type SSLSocket and none of them works, they just give me a public IP address. Is there a way for me to obtain the actual hostname of the client that is connecting to the server?

  • 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-04T17:25:36+00:00Added an answer on June 4, 2026 at 5:25 pm

    Not from the Socket. If the remote host is behind a NAT firewall then by definition its hostname and IP address are invisible to you. All you can see is the public IP and hostname.

    However, you could execute a hostname command at the remote side and pipe the output back over the SSh connection. The data you get back will be only as good as the remote host’s configuration. There’s no guarantee that what you get back matches its internal DNS hostname or anything else.

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

Sidebar

Related Questions

I have a java application that needs to connect to a server. Its rather
I'm writing a client/server application that requires the server needs to be able to
I have a client/server application that remotely connects to a server via Java's SSLSocket.
I have a thick client written in VB6 that connects to an Sql Server
I have an ssl/tls server (nodejs) that acts as a proxy to postfix/sendmail to
i currently have a webservice deployed on a weblogic 10.3 server whit 1-way ssl
I have windows c++ project. Need to implement both ssl client and server on
I have a asp.net mvc application. Some pages require SSL, is there a way
I have spent way too much time trying to sort this little issue out.
Does gettext have a way to warn me about strings that have not been

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.