can not deploy web service via endpoint.publish() in apache reverse proxy env - ssl

we have a weblogic server in the internal network without SSL. To access the application, apache server is installed as a reverse proxy and also have configure SSL. it is ok to deploy web service via endpoint.publish(address) that address is get from httpservletrequest.getRequestURL() if the access url is internal. But failed and throw the below exception if the access url is proxy url. Any idea to publish it via proxy url?
weblogic.wsee.server.ServerURLNotFoundException: Cannot resolve URL for protocol http/https
at weblogic.wsee.server.ServerUtil.getHTTPServerURL(ServerUtil.java:211)
at weblogic.wsee.server.ServerUtil.getServerURL(ServerUtil.java:150)
at weblogic.wsee.server.ServerUtil.getServerURL(ServerUtil.java:137)
at weblogic.wsee.jaxws.spi.WLSEndpoint.calculatePublicAddressFromEndpointAddress(WLSEndpoint.java:335)
at weblogic.wsee.jaxws.spi.WLSEndpoint.publish(WLSEndpoint.java:207)

As per Oracle KM: Secure WebService call throwing CANNOT RESOLVE URL FOR PROTOCOL HTTP/HTTPS through web server(APACHE) plug-in. (Doc ID 1598617.1)
This is a Product Bug 8358398. For wls 10.3.0 to 10.3.2 you need to apply patch for this BUG and set -Dweblogic.wsee.useRequestHost=true
Blockquote
in your JAVA_OPTIONS.
For 10.3.3 and above version you need not to apply the patch. You can only set the above flag to true.

Related

Ontotext GraphDB broken transactions behind HTTPS reverse proxy

I'm setting up the following cloud-based deployment of GraphDB 9.11.1 Free Edition:
the server runs on a Google Compute Engine VM instance listening for HTTP requests on port 80
external requests are routed through an HTTPS load balancer listening on https://example.org/
the graphdb.external-url configuration property is set to https://example.org/ according to the instructions provided # https://graphdb.ontotext.com/documentation/enterprise/configuring-graphdb.html#url-properties
The console is working as expected, but when I try to interact with the database from an external agent using an RDF4J 3.7.7 HTTPRepository (extended binary protocol supporting transactions), I get the following exception:
org.eclipse.rdf4j.repository.RepositoryException: unable to rollback transaction. HTTP error code 404
at org.eclipse.rdf4j.http.client.RDF4JProtocolSession.rollbackTransaction(RDF4JProtocolSession.java:785)
at org.eclipse.rdf4j.repository.http.HTTPRepositoryConnection.rollback(HTTPRepositoryConnection.java:354)
at org.eclipse.rdf4j.repository.http.HTTPRepositoryConnection.close(HTTPRepositoryConnection.java:368)
Looking at network traffic the library is trying to close a transaction using
http://example.org/repositories/data-work/transactions/b99f4327-91d4-4f64-8aa0-c9eb0fb9db92
that is an HTTP transaction URL, where an HTTPS URL would be expected.
Am I missing something or is this an issue with the construction of transaction URLs behind reverse HTTPS proxies?

Is it possible to not integrate Tomcat with apache http server AND have an #Injectable make request to the servlet deployed in Tomcat?

I've been researching how to connect Tomcat and apache http server because I will have my web application written in angular deployed in apache http server 2.2 (currently succesfully tested on my own computer, local), and my REST service written in java deployed in Tomcat v6,
and what I want now is that when some component is clicked, to make a http request (like this http://localhost:8080/rest/getCars/20130505) that connects with the servlet and use the json provided to use the information provided in another component.
So I have created my own url/json to test the web application on itself, but as I said, it is possible to make the same thing but with a real http URI like it can be seen here: https://angular.io/docs/ts/latest/guide/server-communication.html#!#cors
They use:
let wikiUrl = 'http://en.wikipedia.org/w/api.php';
And I use, as of right now:
private datesUrl = 'src/example.json'; // URL to web API
#Injectable()
getDates(): Observable<Date[]> {
return this.http.get(this.datesUrl)
.map(this.extractData)
.catch(this.handleError);
}
So I believe my next step would be to change that datesUrl and write the http written above: http://localhost:8080/rest/getCars/20130505, so that it connects to Tomcat.
But my problem is that I don't know if this is going to work without any connection done between apache http server and tomcat. I've seen there are connectors, like mod_jk and mod_proxy http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass
and so on. I would like to know if, in my case, if I need to use this modules for apache http server or it's not necessary, since I have never seen any of this and install the modules is proving to be a challenge. The end game objective I have is to go from local to a real server, but as far as I know there is no need for anyone from the outside to use the webpage, it's only for the business itself, so with access to the server/machine I could still access localhost, same as I do when I test it locally.
You don't need any special connection between the PHP server and the Tomcat server: it's a plain-old HTTP request. Tomcat doesn't care if your PHP script made that request, or if it came from the open internet.
In the case of the PHP script making the request, it's making its standard HTTP call, and doesn't care that you are running a Tomcat server locally or whatever. Just go ahead and do it. If Tomcat is already responding to HTTP requests on that URL, then calling it from PHP requires no further configuration.

IBM Worklight - Application Center Console - Redirection to port 9080

We are trying to setup the Worklight Server for production, which is behind a reverse proxy that will help manage the SSL certificate.
What this means is that, when the user hit the domain, say https://mydomain.com:443, the proxy will automatically forward the request to the Worklight Server on port 9080.
After the setup is done for the reverse proxy following this guide, the installers.html page is working well. However we notice that when we try to access the console using https://mydomain.com:443/appcenterconsole, the user gets redirect to http://mydomain.com:9080/appcenterconsole/console.html instead and this is causing problem.
I searched around and found this link Worklight Console redirects to port 9080, which is similar to the problem i'm having. Is there a way for me to configure the Websphere Liberty Profile so that it will use the reverse proxy URL as the redirection URL?
I notice also that the index.html file in the appcenterconsole.war is using the meta refresh method to do the redirection. I'm tempted to change it to use a full URL, but then i also notice that the same issue happens when we go to the login.html and perform login. (Whereby after login, the page redirects the user with the 9080 port as well).
Any pointers or idea are welcomes. The Worklight version used is 6.1.
Thank you.
EDIT
The network setup in my environment:
Proxy Gateway (with SSL cert) configured to connect to Worklight Server for port 9080 whenever a connection with port 80 or 443 is received. Therefore:
https://mydomain.com:443/appcenterconsole -> will be mapped to http://worklightserver:9080/appcenterconsole
The mapping is done internally between the proxy and the worklight server.
When we type the full URL on the browser, ie. https://mydomain.com:443/appcenterconsole/console.html after i login, the console works fine.
Have you set up the JNDI entries detailed here?
http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.installconfig.doc%2Fappcenter%2Fr_ac_appres_endpoint.html

Apache module supports in wsman profile

I want to know which all modules in apache server supports wsman profile completly?
Have mod_wsman module for configuring openwsman web service in apache.
You can download source code from this link .https://github.com/Openwsman/mod_wsman
make , install and configure it in apache.
mod_wsman is openwsman-server but without the http stack.
It's an Apache plugin, so you can use the Apache http stack to handle
requests and pass them to the openwsman-server backend for processing.
mod_wsman is not very well maintained.
Assuming by wsman you mean WS-Management...
Of the standard modules that ship with Apache Web Server (httpd). None.
Apache Tomcat also has no support for this.

How to debug HTTP Proxy problems with artifactory?

I have an artifactory within a corporate network. I configured a http proxy for each remote repository. It doesn't work. How could I possibly find out why it doesn't work? Are there any log settings which I could tweak?
Using the same proxy within Firefox works just fine.
Artifactory 2 uses logback for logging, you can find its configuration in $ARTIFACTORY_HOME/etc/logback.xml
If you can access the repository through the browser, it's likely the problem is in your Maven configuration. If you've a proxy configuration defined, you'll need to ensure the proxy is set to exclude your internal http proxy server.
If you run Maven with the -X switch, it will give you more details on the connection attempts Maven is making.