Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jersey-container-jdk-http ignores host and always binds to wildcard address #3383

Closed
jerseyrobot opened this issue May 7, 2016 · 4 comments · Fixed by #5163
Closed

jersey-container-jdk-http ignores host and always binds to wildcard address #3383

jerseyrobot opened this issue May 7, 2016 · 4 comments · Fixed by #5163

Comments

@jerseyrobot
Copy link
Contributor

When using the jersey-container-jdk-http to create a HttpServer, the configuration is passed via an URI, from which protocol, port and path is extracted and used.
Yet, it is not possible to bind the server to the localhost/loopback interface. The HttpServer is always bound to the wildcard address via HttpServer.create(new InetSocketAddress(port), 0)

I would prefer to be able to manually bind the HttpServer at a later time, there should be no need to bind the HttpServer at construction. For the constructor, isHttps and path should be sufficient.

If this change is too complicated, it would help to actually use the host part of the URI for the InetSocketAddress

Affected Versions

[2.22.2]

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by rwma

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
dmitri.priimak said:
Similar issue affects SimpleContainerFactory.create(...) method. And it can be solved easily by changes in method

SimpleContainerFactory#_create(URI, SSLContext, SimpleContainer, UnsafeValue<Server, IOException>)

in line 277 where InetSocketAddress is created ignoring hostname part of the URL.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-3111

@jerseyrobot
Copy link
Contributor Author

@senivam senivam added this to the 2.38 milestone Sep 22, 2022
This was referenced Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants