accepting HTTPS connections with self-signed certificates

前端 未结 13 2107
小蘑菇
小蘑菇 2020-11-22 04:20

I\'m trying to make HTTPS connections, using HttpClient lib, but the problem is that, since the certificate isn\'t signed by a recognized Certificate Authority

13条回答
  •  臣服心动
    2020-11-22 05:01

    Simplest way for create SSL certificate

    Open Firefox (I suppose it's also possible with Chrome, but it's easier for me with FF)

    Visit your development site with a self-signed SSL certificate.

    Click on the certificate (next to the site name)

    Click on "More information"

    Click on "View certificate"

    Click on "Details"

    Click on "Export..."

    Choose "X.509 Certificate whith chain (PEM)", select the folder and name to save it and click "Save"

    Go to command line, to the directory where you downloaded the pem file and execute "openssl x509 -inform PEM -outform DM -in .pem -out .crt"

    Copy the .crt file to the root of the /sdcard folder inside your Android device Inside your Android device, Settings > Security > Install from storage.

    It should detect the certificate and let you add it to the device Browse to your development site.

    The first time it should ask you to confirm the security exception. That's all.

    The certificate should work with any browser installed on your Android (Browser, Chrome, Opera, Dolphin...)

    Remember that if you're serving your static files from a different domain (we all are page speed bitches) you also need to add the certificate for that domain.

提交回复
热议问题