I have no connection to server in ActiveMQ Artemis web console - console

I deploy ActiveMQ Artemis but I get no server connection in my web console. The jolokia-access.xml shows:
<restrict>
<cors>
<!-- Allow cross origin access from localhost ... -->
<allow-origin>*</allow-origin>
<!-- Options from this point on are auto-generated by Create.java from the Artemis CLI -->
<!-- Check for the proper origin on the server side, too -->
<strict-checking/>
</cors>
</restrict>
The web binding is:
<web path="web">
<binding uri="http://0.0.0.0:8161">
<app url="activemq-branding" war="activemq-branding.war"/>
<app url="artemis-plugin" war="artemis-plugin.war"/>
<app url="console" war="console.war"/>
</binding>
</web>
See below the console output and the server logs:

This is almost certainly a problem with your etc/jolokia-access.xml configuration. It's likely that the allow-origin is not configured properly. Here's the default configuration:
<allow-origin>*://localhost*</allow-origin>
You should replace localhost with whatever hostname or IP address where the broker is actually listening for HTTP connections. You can find that information in etc/bootstrap.xml.
For what it's worth, the error in the log has nothing to do with the web console. It is related to the cluster-connection.

Related

Binding web address to localhost

I'm trying to implement a card payment provider to my web shop, but it only accepts a real URLs as success, error and cancel callbacks. For example, the success callback should be https://www.mywebshop.com/Checkout/PaymentSuccessful
As I want to test the mentioned functionality locally, I need to set the payment success callback to https://localhost:44328/Checkout/PaymentSuccessful, but the card payment provider don't accept it (it redirects to error callback instantly).
So, I guess I should add following rows to my hosts file:
127.0.0.1 mywebshop.com
127.0.0.1 www.mywebshop.com
Unfortunately, that didn't work - the local app is running but when I request mywebshop.com, I got messages below (I also tried with https/http/www)
This site can’t be reached
mywebshop.com refused to connect.
When I add a port, like https://mywebshop.com:44328/, I got error:
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
If I add following binding to my applicationhost.config, nothing changes.
<binding protocol="https" bindingInformation="*:44328:mywebshop.com" />
<binding protocol="https" bindingInformation="*:44328:www.mywebshop.com" />
I also tried adding URL reservations with netsh, but it was unsuccessful.
You can use Ngrok for your testing. Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels. Please check how it works page here and its documentation here. Their free plan is sufficient for testing.
So download ngrok and run the ngrok.exe. Run below command which will give you public url - something like http://4a950b92.ngrok.io/ which will point to your local site. Hopefully that will solve your problem.
ngrok http -host-header=localhost 8080

Getting '405 Not Allowed' for PUT/POST Methods in postman in mule 4

I have created a mule application with client_id and client_secret, TLS keystore and deployed on cloudhub. I am able to run application locally but cannot run with cloudhub url.
URL: https://system.us-e2.cloudhub.io/api/refund with PUT method with json body.
It is throwing '405 Not Allowed'
Thanks in advance
Probably you are not pointing to the right application. The error is coming from CloudHub load balancer, indicating that it didn't reach your application. Check that the URL used is the right one for the application. Also that the application is listening in the right port. For CloudHub an HTTPS listening application has to listen in port 8082.
You can try to troubleshoot by contacting directly the application's worker. For example: https://mule-worker-system.us-e2.cloudhub.io/api/refund:8082/...
Your application should have an HTTP Listener configuration like:
<http:listener-connection host="0.0.0.0" port="8082" protocol="HTTPS">
<tls:context>
<tls:trust-store path="keystore.jks" password="123456"/>
</tls:context>
</http:listener-connection>
Note that in this configuration the port used is "8082".

WSO2 API Manager Ports

I am having a requirement to publish all APIs developed to run on ports 80 and 443 instead of 8280 and 8243.
I changed the axis2.xml as below and restarted the API Manager server.
<parameter name="port" locked="false">80</parameter>
<parameter name="port" locked="false">443</parameter>
I can see published APIs in API store showing 80 and 443 ports respectively.
But when I am trying to test it using Postman like below URL, it throws the below error.
URL: http://localhost:80/pizza & https://localhost:443/pizza
Error: HTTP Error 404. The requested resource is not found.
Please suggest if there is any configuration missing.
Thanks.
I don't think you can do that. If you want to expose your APIs with 80/443, you need to front APIM with a reverse proxy as explained in [1].
[1] https://docs.wso2.com/display/AM210/Adding+a+Reverse+Proxy+Server

WSO2 API Manager: How to listen PassThroughHttpListener on single IP address

When I start the WSO2 AM, I see that AM is listing to all IP-adresses on the server:
PassThroughHttpListener Pass-through HTTP Listener started on 0.0.0.0:8280
I want to bind to a single IP address. IMHO I thing I should change the axis2.xml file? I should change all
<transportReceiver name="http"
class="org.apache.synapse.transport.passthru.PassThroughHttpListener">
...
<parameter name="bind-address" locked="false">172.29.4.97</parameter>
Is this correct?
As in the comments; Issue is not implemented in PassThrough Listener, issue logged: https://wso2.org/jira/browse/APIMANAGER-2001

Flex/AIR + GraniteDS through SSL

I am running JBoss with SSL, the certificate is generated with openssl:
<Connector protocol="HTTP/1.1" SSLEnabled="true"
port="8443" address="${jboss.bind.address}"
scheme="https" secure="true" clientAuth="false"
keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
keystorePass="password" sslProtocol = "TLS" />
My client is an AIR application which interacts with the Java EE Server through GraniteDS. On the Flex/AIR side, I updated the channel to a SecureAMFChannel on services-config.xml:
<channel-definition id="myApp-graniteamf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint uri="https://localhost:8443/myApp/graniteamf/amf"
class="flex.messaging.endpoints.SecureAMFEndpoint" />
</channel-definition>
Now, when I connect from my client, AIR asks me if I want to go ahead with the connection (view certificate, etc.).
I'm new to the whole SSL/HTTPS concept, but I've read some docs. What I'm trying to figure out now, is how to make my App know that a server is safe (localhost in this case). From what I got so far, the client application should "trust the server as a CA", or just trust the certificates from a certain server.
Can you give me some clues as to where to start to implement this on my AIR client side application?
If I understand correctly, you are using a self signed certificate. Going on that assumption you can't force a user to accept the certificate through your AIR app, that would be a security hole. To get a call from your AIR app to be trusted the user would need to import your certificate (or the untrusted CA you signed your certificate with) into their own keystore.
The way you do this is different for each OS, but an example of how to do it in Windows is to browse your server in IE, Get the cert warning, view the cert details and then export the cert to file (X509 iirc). Then you can right click the cert file and chose to install the certificate.
All subsequent calls to that secured server should then be trusted.

Resources