First I downloaded the certificate with:
echo "" | openssl s_client -connect io.lightstream.bitflyer.com:443 -showcerts 2>/dev/null | openssl x509 -out bitflyer.cerThen I imported the certificate into a keychain:
keytool -import -file bitflyer.cer -alias bitflyer -keystore bitflyer.jks -storepass "abc123" -keypass "abc123"So I'm trying to connect to io.lightstream.bitflyer.com:443. Below my full handshake:
Sending HTTP handshake! req=GET / HTTP/1.1Host: io.lightstream.bitflyer.comConnection: UpgradePragma: no-cacheCache-Control: no-cacheUpgrade: websocketSec-WebSocket-Key: 0enPg4mnHvLcT6s7+4mEGA==Origin: http://www.websocket.orgSec-WebSocket-Version: 13But then I get:
Caused by: sun.security.validator.ValidatorException: Certificate signature validation failed at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:215) at sun.security.validator.Validator.validate(Validator.java:262) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:330) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:289) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:144) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1626) ... 16 moreCaused by: java.security.SignatureException: Signature does not match. at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:449) at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:392) at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:213) ... 21 moreAny ideas what am I doing wrong or how to debug that? Thanks!