HPE OneView
1751920 Members
4619 Online
108783 Solutions
New Discussion

SCMB 404 not found

 
SOLVED
Go to solution
Jacob_Just
Occasional Advisor

SCMB 404 not found

Hi

 

I have implemented an integration using the rest api, now I want to connect to the SCMB, but when I try to create the certificate it fails, it seems like that part of the api/service are not running. 

 

This is my request: 

POST /rest/certificates/client/rabbitmq HTTP/1.1
Host: 10.169.115.205
auth: pAbBxI0ePmgzru_vcGj1zNPSObt4X6Rb
Content-Type: application/json

{ "type":"RabbitMqClientCertV2", "commonName":"default" }

 

And I get a 404 as response:

{"errorSource":null,"nestedErrors":[],"errorCode":"GENERIC_HTTP_404","data":{},"recommendedActions":["Check the request URI, then resend the request."],"details":"The requested resource could not be found.","message":"Not Found"}

 

 

I´m using the newest OneView trial version 1.10.

 

Best Regards

Jacob Just

7 REPLIES 7
ChrisLynch
HPE Pro

Re: SCMB 404 not found

Hello, and thank you for your question.  If what you provided is the complete API request, you are missing the X-API-Version header from your request.  As documented in the API Reference, X-API-Version is a required header.  I just validated that if the X-API-Version header is missing, the HTTP 404 error is what's generated.  If you add the X-API-Version header with the correct API version (in the case of 1.10, the value would be 101), you will get an HTTP 200 if the RabbitMQ default user cert was not generated before, or an HTTP 409 stating the cert was already generated.

 

Also, you should always perform a GET /rest/certificates/client/rabbitmq/keypair/default, prior to issuing a HTTP POST request.


I am an HPE employee

Accept or Kudo

Jacob_Just
Occasional Advisor

Re: SCMB 404 not found

Hi Chris 

 

Thank you for your fast help, Now I´m able to get all the certificates and keys, besides what was mentioned in the java example I have created a truststore and added the ca certificate to it, like this: 

keytool -keystore truststore -importcert -alias rabbitmq_readonly -file caroot.pem

 

When I´m running the java example it fails on factory.newConnection();

 

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.jdt.internal.launching.LongCommandLineLauncher.main(LongCommandLineLauncher.java:43)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:882)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1203)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:654)
	at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:100)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	at java.io.DataOutputStream.flush(DataOutputStream.java:106)
	at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:129)
	at com.rabbitmq.client.impl.SocketFrameHandler.sendHeader(SocketFrameHandler.java:134)
	at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:276)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:590)
	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:612)
	at com.apc.external.model.monitoring.hp.SCMBTest.main(SCMBTest.java:63)
	... 5 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
	at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863)
	... 17 more

 

I´m using the client jar file from: http://www.rabbitmq.com/

 

Do you have any ideas?

Are there any log files on the OneView server I can look at, to track down the issue.

 

Best Regards

Jacob

ChrisLynch
HPE Pro

Re: SCMB 404 not found

I have no experience in Java development.  But based on the error you pasted, it appeared that the appliance didn't accept your client certificate during the SSL negotiation.  As for logs on the appliance, we do not provide access to the internals for customers or partners.

 

What specific Java client and version did you download from rabbitmq.com? I will look to see if someone can provide some guidance on this issue.

 

 


I am an HPE employee

Accept or Kudo

ChrisLynch
HPE Pro
Solution

Re: SCMB 404 not found

Can you please attach you the Java code you are using to connect to the SCMB endpoint?  You can use the Add Attachment option when creating a reply in this conversation.


I am an HPE employee

Accept or Kudo

Jacob_Just
Occasional Advisor

Re: SCMB 404 not found

Today I tried the Python example from Git, that is working fine:-)

I compared the certs / and keys downloaded from the python example, and the are identical to the ones I have downloaded, and using from java. 

Attached the ssl debug log from java, and the jave source code for the example. Also attached the certificates / keys, and the commands I use to create the keystore and trust store.

I have tried with sun jre 1.6.35, 1.6.45 and 1.7.67.

The rabbitmq I´m using: rabbitmq-java-client-bin-3.3.5

 

Best Regards

Jacob

Jacob_Just
Occasional Advisor

Re: SCMB 404 not found

I tried on another computer runing Mac os, and here everything works, thank you for your support.

Jacob_Just
Occasional Advisor

Re: SCMB 404 not found

Now it is also working on my windows machine. I added the oneview server to the host file and it worked. The Oneview are running on vmware and are not registrered on the dns server, this seems to confuse java on windows, even if I use the ip address when connecting.