This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 238843 - IllegalArgumentException: Invalid characters in hostname
Summary: IllegalArgumentException: Invalid characters in hostname
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Antonin Nebuzelsky
Keywords: JDK_8
: 239632 258756 (view as bug list)
Depends on:
Reported: 2013-11-26 19:40 UTC by dimaki
Modified: 2016-04-21 22:38 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 205593

stacktrace (2.80 KB, text/plain)
2013-11-26 19:40 UTC, dimaki

Note You need to log in before you can comment on or make changes to this bug.
Description dimaki 2013-11-26 19:40:19 UTC
Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) Client VM, 25.0-b59, Java(TM) SE Runtime Environment, 1.8.0-ea-b117
OS: Windows 7

User Comments:
dimaki: Cannot connect to GIT repo.

java.lang.IllegalArgumentException: Invalid characters in hostname
Comment 1 dimaki 2013-11-26 19:40:23 UTC
Created attachment 142612 [details]
Comment 2 Ondrej Vrabec 2013-11-26 19:47:11 UTC
What URL are you entering before getting this exception? It must be an invalid one.
Comment 3 dimaki 2013-11-26 20:04:58 UTC
No. It's the one pasted directly from the project page. The URL is working fine when using 'git clone ...' on the command line. I tried the HTTPS and the SSH URL.
I switched back to jdk 1.7.0_45 and rebooted the system and now git clone works.

(In reply to Ondrej Vrabec from comment #2)
> What URL are you entering before getting this exception? It must be an
> invalid one.
Comment 4 Ondrej Vrabec 2013-11-27 09:23:12 UTC
with jdk 1.8 b116 this worked fine, started occurring in b117. This seems to happen when trying to open a http(s) connection to a server with username in the URL:

From debugging:
1) at
2) at<init>(
3) at$Authority.<init>(
4) at
5) at
6) at<init>(

6) called as URLPermission("", "GET:Accept-Encoding,Pragma,User-Agent,Accept")
3) instantiated as URLPermission$Authority("https", "")
2) finally hostname is incorrectly parsed in HostPortrange.<init> and tries to call toLowerCase(

100% reproducible, cannot clone a git repository over https with authentication
Comment 5 Ondrej Vrabec 2013-11-27 13:00:06 UTC
the difference between b116 and b117 is the last step in the stacktrace. While b116 simply called:
> hoststr = hoststr.toLowerCase();
b117 now calls:
> hoststr = HostPortrange.toLowerCase(hoststr);
In both builds the current value of hoststr was "", the new method cannot handle '@' and throws the exception. According to spec at username may probably contain also other non-ascii characters (encoded as %XX i guess) so permitting only '@' may not be sufficient. JDK should probably correctly parse just the host name and skip the userinfo part of the URI.
Comment 6 Antonin Nebuzelsky 2013-11-29 10:46:12 UTC
Ondro, thanks for the detailed evaluation.

JDK bug:
Comment 7 Ondrej Vrabec 2013-12-19 08:27:13 UTC
*** Bug 239632 has been marked as a duplicate of this bug. ***
Comment 8 Jiri Prox 2016-04-21 22:38:49 UTC
*** Bug 258756 has been marked as a duplicate of this bug. ***