cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

431
Views
0
Helpful
2
Replies
Highlighted
Beginner

How to connect to virtual device on AiO VM from Mac?

I have installed onePK SDK for Java on my Mac. What I want is to run tutorials from sdk. For connection I use All-in-One VM and demo 3node network. VM runs under VMWare fusion. I can ping virutal devices from Mac. The problem is that when I run SessionTutorial (as I can understamd we need to run it first)  I have a following error:

28   [main] TRACE com.cisco.onep.element.NetworkElement  - Connect called for username:alex

482  [main] TRACE com.cisco.onep.element.NetworkElement  - connectIDL: appname [Session Tutorial] hostname[Alexs-MacBook-Pro-2.local] username [alex] timer [60] sessionid [0]

676  [main] ERROR com.cisco.onep.element.NetworkElement  - Thrift exception: org.apache.thrift.transport.TTransportException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

677  [main] ERROR com.cisco.onep.element.NetworkElement  - Could not connect to NetworkElement: com.cisco.onep.core.exception.OnepTransportException: Error occurred in the operation. Failed to connect to the network element or the session is closed. Failed to connect to the network element or the session is closed. javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

677  [main] TRACE com.cisco.onep.element.NetworkElement  - Disconnecting

677  [main] TRACE com.cisco.onep.element.NetworkElement  - Terminated API and Event channels

682  [main] TRACE com.cisco.onep.element.NetworkElement  - Resources released, state set to disconnected

682  [main] TRACE com.cisco.onep.element.NetworkElement  - Disconnect complete

683  [main] ERROR com.cisco.onep.tutorials.session.SessionTutorial  - Failed to connect to element.

com.cisco.onep.core.exception.OnepTransportException: Error occurred in the operation. Failed to connect to the network element or the session is closed. Failed to connect to the network element or the session is closed. javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

    at com.cisco.onep.element.NetworkElement.connect_(NetworkElement.java:2102)

    at com.cisco.onep.element.NetworkElement.connect(NetworkElement.java:1980)

    at com.cisco.onep.tutorials.session.SessionTutorial.connectWithConfig(SessionTutorial.java:268)

    at com.cisco.onep.tutorials.session.SessionTutorial.main(SessionTutorial.java:81)

Caused by: org.apache.thrift.transport.TTransportException: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

    at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147)

    at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:163)

    at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:91)

    at com.cisco.onep.idl.NetworkElementIDL$Client.send_NetworkElement_connectIDL(NetworkElementIDL.java:250)

    at com.cisco.onep.idl.NetworkElementIDL$Client.NetworkElement_connectIDL(NetworkElementIDL.java:244)

    at com.cisco.onep.element.NetworkElement.connect_(NetworkElement.java:2077)

    ... 3 more

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:1188)

    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 org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145)

    ... 8 more

Caused by: java.io.EOFException: SSL peer shut down incorrectly

    at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:462)

    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863)

    ... 12 more

Actually I have something similar when I run other tutorials. How can I solve this problem?

Everyone's tags (3)
2 REPLIES 2
Hall of Fame Cisco Employee

Re: How to connect to virtual device on AiO VM from Mac?

OnePK requires TLS now.  You must build a Java truststore file and specify the path to that file for running the tutorials.  Check out the Getting Started Guide on the AiO VM desktop and look at the Security section.  This will walk you through configuring TLS on the device as well as the command line options for the various tutorials.  You can copy the truststore.jks file from the AiO VM to your Mac since you only care about connecting to the IOSv instances.

If you still get an SSL error, you will want to make sure you're connecting to the devices with the right address.  This might mean you need to establish routing through the Linux VM to the IOSv instances.  This can be done by adding a static route on the Mac (e.g., sudo route add -net 10.10.10.0/24 192.168.1.129), then adding appropriate default routes on the IOSv instances.

Beginner

Re: How to connect to virtual device on AiO VM from Mac?

Thank you very much. I think I need to establish routing becauce I have a truststore file.

Content for Community-Ad
FusionCharts will render here