0

I cannot connect to a IPv6 server through HttpsURLConnection, getInputStream() returns null when I sent a request.

I didn't find any useful information: Android developer guide said HttpURLConnection can transparent support IPv6, but didn't mention HttpsURLConnection can support IPv6 or not. Does anyone have experience about this?

Update - 1:

On server side I found a error log when connection failed:

[error] Hostname [xxxx:xxxx:x:xx::xxx] provided via SNI and 
        hostname xxxx:xxxx:x:xx::xxx provided via HTTP are different

To connect to same IPv6 Apache server (version 2.2.27), Apache HttpClient works without any problem, but HttpsURLConnection doesn't. So it may not be a server side issue. Does anyone see this error before when using HttpsURLConnection?

Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
Jing-Wei Wu
  • 138
  • 1
  • 9
  • Your edit constitute a whole new question, which should be asked and tagged separately. – user207421 May 21 '14 at 02:49
  • ok I would create another [question](http://stackoverflow.com/questions/23773276/httpsurlconnection-cannot-connect-to-ipv6-server), and thanks for your help. – Jing-Wei Wu May 21 '14 at 03:08

1 Answers1

0

Java supports IPv6, and has done for many years. HttpsURLConnection supports whatever Java supports.

You might also have noticed that HttpsURLConnection extends HttpURLConnection.

user207421
  • 305,947
  • 44
  • 307
  • 483