How to create an https Connection in Android?

后端 未结 2 864
北荒
北荒 2021-01-07 15:43

I found lots of posts in Stackoverflow but could not get the solution working for :

How to create an https Connection in Android?

Code is :

          


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 16:18

    There are couple of things that you have to do when you are doing https communication with server.

    1. Create a cretificate using OpenSSL tool using Bouncy Castle.

    2. Load the cretificate into code and teach your code to use that.

    3. Finally hit the URL to get the response using HttpResponse class

    A nice example which define how it works by step by step guide is explained in this link http://www.compiletimeerror.com/2013/01/login-application-for-android-android.html#.VSE1ftyUfTB

提交回复
热议问题