我有一个在 Windows Server 2008 R2 上的 IIS 7.5 中运行的 AS2 服务器应用程序 (RSSBus)。我有一些可以通过 HTTP 正常工作的活动连接,但没有一个可以通过 HTTPS 工作的连接。我曾尝试在两个不同的贸易伙伴处建立 HTTPS 连接,但它们都失败了,而且我从他们那里收到的错误消息非常相似。请注意,我为我正在使用的域配置了一个有效的 SSL 证书,我相信它工作得很好。
我从贸易伙伴那里收到的错误让我相信问题是我的配置错误,但我无法找出问题所在。
以下是其中一个错误(我已经编辑了一些识别信息):
2018/10/30 16:38:33 Run: type="API"
2018/10/30 16:38:35 Detail: "Using proxy http://xxxxxxxx:8080..." level=1
2018/10/30 16:38:35 Result: "Success" "Return status=0"
2018/10/30 16:38:35 Detail: "Connecting to https://www.yyyyyyyy.com:443..."
2018/10/30 16:38:35 File: source="/edi/mft/harmony/sendtest/sendTest_X12" direction="Local->Host" number=1 of 1 fileSize=529 fileTimeStamp=2018/10/30 16:38:35 transferID="AS2-20181030_163835722-J" docDBTransferID="37ede9ac-a23d-4ed6-85bc-879d4939a04f"
2018/10/30 16:38:35 HTTP: "POST /rssbus/pub/Receive.rsb"
2018/10/30 16:38:35 Detail: "AS2-From: SenderAS2Id, AS2-To: ReceiverAS2Id, Subject: EDIINTDATA, Content-Type: X12"
2018/10/30 16:38:35 Detail: "Sending signed and encrypted [TripleDES] message to ReceiverAS2Id..." level=1
2018/10/30 16:38:44 Exception: "java.io.EOFException: Connection closed by remote host.
at iaik.security.ssl.Utils.a(SourceFile:291)
at iaik.security.ssl.ab.b(SourceFile:452)
at iaik.security.ssl.ab.e(SourceFile:374)
at iaik.security.ssl.y.f(SourceFile:365)
at iaik.security.ssl.n.b(SourceFile:729)
at iaik.security.ssl.n.a(SourceFile:1509)
at iaik.security.ssl.y.d(SourceFile:784)
at iaik.security.ssl.SSLTransport.startHandshake(SourceFile:569)
at iaik.security.ssl.SSLSocket.startHandshake(SourceFile:386)
at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3094)
at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:2910)
at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:2702)
at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1148)
at com.cleo.lexicom.protocols.http.HTTP.post(HTTP.java:750)
at com.cleo.lexicom.beans.as2bean.HttpSender.prepareToSend(HttpSender.java:206)
at com.cleo.lexicom.beans.as2bean.SMimeClient.sendSignedThenCompressedAndEncryptedMessage(SMimeClient.java:2163)
at com.cleo.lexicom.beans.as2bean.SMimeClient.sendMessage(SMimeClient.java:364)
at com.cleo.lexicom.beans.as2bean.AS2Action.post(AS2Action.java:398)
at com.cleo.lexicom.beans.httpbean.HttpAction.issue(HttpAction.java:2602)
at com.cleo.lexicom.beans.httpbean.HttpAction.put(HttpAction.java:1139)
at com.cleo.lexicom.beans.httpbean.HttpAction.put(HttpAction.java:890)
at com.cleo.lexicom.beans.httpbean.HttpAction.putFile(HttpAction.java:846)
at com.cleo.lexicom.beans.httpbean.HttpAction.putFile(HttpAction.java:800)
at com.cleo.lexicom.beans.httpbean.HttpAction.putFileLoop(HttpAction.java:704)
at com.cleo.lexicom.beans.httpbean.HttpAction.put(HttpAction.java:614)
at com.cleo.lexicom.beans.httpbean.HttpAction.macroCommand(HttpAction.java:461)
at com.cleo.lexicom.beans.LexActionBean.executeCommand(LexActionBean.java:4199)
at com.cleo.lexicom.beans.LexActionBean$LexBeanRunCommand.run(LexActionBean.java:4315)
at java.lang.Thread.run(Thread.java:748) "
2018/10/30 16:38:44 Hint: "Host did not send a complete response before closing connection."
2018/10/30 16:38:44 Result: "Exception" "java.io.EOFException: Connection closed by remote host."
2018/10/30 16:38:44 End
我在此连接测试期间运行了 wireshark,我看到它通过了正常的连接过程,但是在我看到从发送方到我的服务器的“客户端密钥交换、更改密码规范、加密握手消息”之后,我的服务器发回 [ RST,ACK],如下图:
我查看了我的 AS2 服务器上的连接超时设置,它设置为 60 秒,我认为这已经足够长了,从上面的时间戳来看,几乎立即发送了重置。
在我的服务器上,我使用应用程序 IIS Crypto 仅启用“最佳实践”协议(TLS 1.0、1.1、1.2)、密码(3DES 168、AES 128/128、AES 256/256)、哈希(MD5、SHA 、SHA 256、SHA 384、SHA 512)和密钥交换(Diffie-Hellman、PKCS、ECDH)。有可能我禁用了我的贸易伙伴正在使用的某些东西,但我知道他们都在使用 TLS 1.2,而且我在 Wireshark 信息中看到了 Diffie-Hellman 密钥,所以我也不认为是这种情况。但是,我对此的了解非常有限,因此我可能会走得很远。
我真的只是想弄清楚下一步该往哪里看。Wireshark 中有什么东西可以用来解决问题吗?我试过检查一些框架,但还没有看到任何对我有很大帮助的东西。
请注意,当我从 HTTPS 切换到 http 时,同样的连接测试也会成功。该成功测试可以在下面查看:
2018/10/30 16:28:37 Run: type="API"
2018/10/30 16:28:38 Detail: "Using proxy http://xxxxxx:8080..." level=1
2018/10/30 16:28:38 Result: "Success" "Return status=0"
2018/10/30 16:28:38 Detail: "Connecting to http://www.yyyyyyy.com:80..."
2018/10/30 16:28:38 File: source="/edi/mft/harmony/sendtest/sendTest_X12" direction="Local->Host" number=1 of 1 fileSize=529 fileTimeStamp=2018/10/30 16:28:38 transferID="AS2-20181030_162838070-J" docDBTransferID="d621b86f-0600-46bb-ac12-3cb5bb9e6203"
2018/10/30 16:28:38 HTTP: "POST /rssbus/pub/Receive.rsb"
2018/10/30 16:28:38 Detail: "AS2-From: SenderAS2Id, AS2-To: ReceiverAS2Id, Subject: EDIINTDATA, Content-Type: X12"
2018/10/30 16:28:38 Detail: "Sending signed and encrypted [TripleDES] message to ReceiverAS2Id..." level=1
2018/10/30 16:28:38 Detail: "Waiting for response..." level=1
2018/10/30 16:28:38 File: source="MDN" direction="Host->Local" destination="AS2/mdn/xxxxx/received/CLEO-20181030_212838173-44K62B@08925485US00_8436230-J_20181030-162838.mdn" number=1 of 1
2018/10/30 16:28:38 Response: "200 OK"
2018/10/30 16:28:38 Result: "Success" "Sent and Received Message Integrity Check codes match Source file copied to '/edi/mft/data/AS2/edi/xxxxx/sentbox/sendTest_X12_HY1139-MB8931_20181030-162838'."
2018/10/30 16:28:38 End
