B4A Library SSLPins

SSL Certificate pinning inspired by https://www.b4x.com/android/forum/threads/okhttp-set-parameter-with-inline-java.64748/ post but updated to work.

You need to change sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= with the required public key.

Use doCheckRequest to find the correct key required.

Version: 1.0
  • SSLPins
    • Events:
      • ready (response As String)
    • Functions:
      • doCheckRequest (url As String) As String
      • getRequest (Ia As String)
      • Initialize (evname As String, KEY As String)
      • PostJsonRequest (Ia As String, Json As String)


B4X:
requester.Initialize("a", "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=")

Log(requester.doCheckRequest("b4x.com"))

requester.getRequest("b4x.com")

Requires: okhttp-3.9.1 and okio-1.13.0 in your lib folder
 

Attachments

  • SSLPins.zip
    2.7 KB · Views: 212
  • example.zip
    8.3 KB · Views: 235
Last edited:
Top