我正在使用 BouncyCastle 通过 UDP 实现 SSL。我有两个使用 UDP 相互通信的独立 JVM。这些是独立的 JVM,而不是任何类型的 Web 或应用程序容器。
我该如何实施?
我使用了 BouncyCastle 的测试类,但出现异常:
Exception in thread "main" java.net.PortUnreachableException: ICMP Port Unreachable
at java.net.PlainDatagramSocketImpl.send(Native Method)
at java.net.DatagramSocket.send(DatagramSocket.java:697)
at org.bouncycastle.crypto.tls.UDPTransport.send(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSRecordLayer.sendRecord(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSRecordLayer.send(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake$RecordLayerBuffer.sendToRecordLayer(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake.writeHandshakeFragment(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake.writeMessage(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSReliableHandshake.sendMessage(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSServerProtocol.serverHandshake(Unknown Source)
at org.bouncycastle.crypto.tls.DTLSServerProtocol.accept(Unknown Source)
可能的原因是什么?我没有设置任何服务器。