2
votes

I have deployed the PizzaShackAPI sample in the WSO2 API Manager. I receive an error on the API Manager command prompt, when I try to invoke it through the store:

Error at Command Prompt:

ERROR - SourceHandler I/O error: Unrecognized SSL message, plaintext connection?
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:156)
    at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:868)
    at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
    at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
    at org.apache.http.nio.reactor.ssl.SSLIOSession.doUnwrap(SSLIOSession.java:245)
    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:280)
    at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:410)
    at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:119)
    at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:159)
    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)
    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:586)
    at java.lang.Thread.run(Thread.java:745)

Error in API Store:

{
  "error": "no response from server"
}

My configuration:

JDK - 1.8, WSO - 2.0

Can someone please help and provide some direction?

3

3 Answers

3
votes

You are using wrong port, You must use either of following ports with relevant protocols.

For accessing APIs through HTTPS, use following

https://localhost:8243/pizzashack/1.0.0/menu

For accessing APIs through HTTP, use following

http://localhost:8280/pizzashack/1.0.0/menu
1
votes

You request URL is wrong. It should be

https://localhost:8243/pizzashack/1.0.0/menu

Looks like you have changed below section of api-manager.xml incorrectly.

<GatewayEndpoint>http://${carbon.local.ip}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port}</GatewayEndpoint>
0
votes

Try executing the following curl command from your terminal. This should send you the correct response

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer <Key>' 'https://localhost:8243/pizzashack/1.0.0/menu'

As explained in the other answers the the gateway endpoint is being pointed to a wrong url in your configurations. This works perfectly in a fresh pack.

EDIT

in order to solve the certificate issue, append the command with '-k'.

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer <Key>' 'https://localhost:8243/pizzashack/1.0.0/menu -k'