Jersey client with multi domain uri - jersey

I am using Jersey Client API to talk to REST server.
Client is having problem in connecting to URL with multiple sub-domains.
EX : https://domain1.domain2.abc.com.
This throws 503 service unavailable.
i trusted all the certs and bypassed host name verification.
Even with HttpsUrlConnection API i get the same 503 error.
But when i hit the same URL with CURL that works fine.
I see the Client API works well with https://domain2.optum.com.
Is there any restriction for Jersey Client (HttpsUrlConnection)API with sub domain names in the URL?

Related

Rest api call via proxy failing with 503 error

I have to make a rest api call via proxy. The proxy is a http url whereas the actual api is a https url. So do i need to pass certificate api call ?
When i make call without loading the certificates its giving me HTTP 503 Service Unavailable error.

How can you deploy a spring boot application with HTTPs without making any changes to the application?

I have a spring boot application which works over http.I do not want to touch the application - so no keystore etc. I want to use reverse proxy - i.e. the request will land at some other machine over TLS and
will get redirected to my spring boot application over secure socket layer. How it could be done?
Edit: When I try to login to that site, developer tool console tells me:
"Mixed Content: The page at 'https://xxxx-uat.xxxx.com:4200/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://151.253.73.106:9091/login'. This request has been blocked; the content must be served over HTTPS."
Nginx reverse proxy is being used.
Best way to do it is to use cloudflare. Cloudflare is free for basic use. You can create a new site, point to your HTTP URL and configure SSL as flexible. So, now your service is behind https. Cloudflare will act as proxy. Request will go to cloudflare via https, then it will be routed to your http.

Browser not responding to www-authenticate challenge for bookmarked ssl (https url) to restricted resource

I have set up SSO using weblogic on windows and Kerberos, It is working fine for the http pages, however I observed a strange behavior on https pages which requires CONFIDENTIAL setting for the transport, It works fine if I first access a page on http which is not configured as secured in web.xml(Transport-Gurantee as None) and then the https page.
But If I try to hit the https url directly which is configured with Transport-Gurantee as CONFIDENTIAL then it shows the Basic Auth Dialog and a 401 Unauthorized response, Looking at the logs I see that the Server responded with the WWW-Authenticate but browser showed the Basic Auth Dialog in response instead of getting the Authorize token.
Does anyone has any idea on what might be issue here, If there is any problem with the browser settings then it would not have worked irrespective of accessing the http url first.
I can see the following error log in weblogic console
Malformed request "Can not parse URI from http request". Request parsing failed, Code: -1
Found one of the link here
SPNEGO on IBM WebSphere Portal 6.1 with https
For my case it is weblogic 12c , I don't think reinstalling 12c is a valid solution for it
Ok I got it fixed , It turns out to be an issue with the browser configuration , the https://myserver.domain.com was not inside the intranet domain and the control to do that rests with the windows Admin team, once they added it , the https urls are also working fine.

WSO2 API console requested an insecure XMLHttpRequest endpoint

Am using WSO2 API Manager 1.9.1 and have defined a service that can be access over both http and https. When I try to "test" it through the API Console under https://localhost:9443/store/apis/..., the API call fails as the REST AJAX call is send over http instead of https.
Chrome complains that the page was loaded over HTTPS but requested an insecure XMLHttpRequest. The request is blocked as it should be served over HTTPS.
Firefox likewise blocks the request with a "mixed active content" error.
Safari fails with a more obscure message: "Failed to load resource: The network connection was lost.".
A workaround is to set the API scheme to https only but this is not particularly desirable. Is there a fix or other way to cope with this issue?
This issue occurs when you're trying to access a HTTPS URL from the web browser
but the end point is actually HTTP. This is not the default behavior of swagger console in API manager 1.9.
Usually when you are accessing from the web browser using HTTPS, API console
(swagger console) calls an end point of HTTPS by default.
Try to expose the service as both HTTP and HTTPS(Manage Tab) when you are publishing an API.
Thanks
Ojith

How to Configure web service client endpoint url?

We have a situation, our interface partner is calling our web service dynamically by calling our WSDL and consume web methods by using the endpoint defined in the WSDL.
Here, the problem is - As we are using reverse proxy server, the actual web service is hosted in different content server and have URL rewrite rule configured in proxy server to redirect the request to real content server. Our interface partner is successfully consumed our WSDL by using the given reverse proxy URL, but the WSDL is having the real content server URL and our interface partner is not having access to it.
They can change the endpoint url in their proxy class and consume the web service via the reverse proxy URL; unfortunately, they are using some common framework to dynamically build the end point from the received WSDL. So our client could not consume our web service.
Is there any way to determine the client's endpoint url in web service? Thanks in advance.
open wsdl file in browser. save as on local system with .wsdl extension. in client code give url of local file instead of server address as given below.
url = new URL("file:/C:/apps/Services.wsdl");

Resources