Get certificate and add it to a Java truststore, when only having https URL?

前端 未结 3 782
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 22:54

I\'m trying to send push notifications to Android devices through the Google Cloud Message servers.

The URL we use to do that is:

https://android.goo         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 23:48

    If you have openssl you can use

    openssl s_client -connect android.googleapis.com:443
    

    s_client is a "generic SSL/TLS client which connects to a remote host using SSL/TLS", and among other things it prints out the server certificate it received from the remote server. It isn't an HTTP client, so it doesn't know to follow the 301 redirect, it'll just give you the certificate of the initial server you connected to.

提交回复
热议问题