Android Question okHttp - javax.net.ssl.SSLProtocolException SHA-256

MarcoRome

Expert
Licensed User
Longtime User
Hi all. Time ago i write time ago one library Paypal credit card, now seem that this library have a few problems with SSL, when i call:
B4X:
https://api.sandbox.paypal.com/v1/oauth2/token","grant_type=client_credentials")

find message i have this error:
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
After i change this line code:
B4X:
Change hc.Initialize in HttpUtils2Service to hc.InitializeAcceptAll
as suggestion Erel HERE

Now i have this error:

Any idea ?
Thank you
Marco
 

MarcoRome

Expert
Licensed User
Longtime User
Yes i have some Error:



and without modified library ( hc.Initialize.... ), i use in this contest okHttp library + okHttpUtils2 library
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User




This is error:
Compiled B4A 5.80 #1 / JDK 1.8.0_66 / android.jar ( 23 )

 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
I have try also with HttpUtils2 ( 2.01 ) / Http ( 1.36 )
But i have some effect.
The thing strain is that work with a lot program that use HttpUtil and i havent this problem with another apps.
Today i try also with another devices.
anyway this is error:





 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
Sandbox Endpoints - Ready Now
The PayPal Sandbox endpoints have been configured with the latest security standards to which the Production endpoints will be moving. You can use these endpoints to verify that your code supports the required standards prior to the Production endpoints getting updated. These endpoints have been upgraded to the new SHA-256, 2048-bit certificates:
  • api.sandbox.paypal.com
  • api-3t.sandbox.paypal.com
  • api-aa.sandbox.paypal.com
  • api-aa-3t.sandbox.paypal.com
  • svcs.sandbox.paypal.com
  • pointofsale.sandbox.paypal.com
  • ipnpb.sandbox.paypal.com
  • www.sandbox.paypal.com (for IPN)

Production Endpoints - Ready after June 17, 2016
The following Production endpoints will be upgraded to new SHA-256, 2048-bit certificates after June 17, 2016:
  • api.paypal.com
  • api-3t.paypal.com
  • api-aa.paypal.com
  • api-aa-3t.paypal.com
  • svcs.paypal.com
  • ipnpb.paypal.com

https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1766&expand=true&locale=en_US
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
I realized this error because one of our colleagues (that use device Huawei with Android 4.2) has had this problem with Library PayPal CreditCard ( HERE )
So i try the library and actually the problem exists. Until december 2015 never had this problem.
Is it possibile that also THIS depends because they have made changes ?
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
But anyway this code should be valid:

B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim j As HttpJob
   j.Initialize("", Me)
   j.Download("https://api.sandbox.paypal.com/v1/oauth2/token")
    
End Sub

Sub jobdone(j As HttpJob)
   Log(j)
End Sub

or no ?
 
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Not sure why it doesn't work on your device. It does work here with OkHttp. You will need to use Http for now.
Maybe understand because dont work.



"Updating Your Security Provider to Protect Against SSL Exploits" from Google.
Found this information HERE

Erel do you have any tricks ?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…