#kimvincible_code

1 messages Β· Page 1 of 1 (latest)

tepid swanBOT
#

πŸ‘‹ Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

πŸ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1441393852614180874

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

candid barn
#

πŸ‘‹ Hi there

#

Is this happening on an emulator, or a certain device?

copper owl
#

certain device. Samsung S23+

#

πŸ‘‹ hi btw

candid barn
#

Does it happen on other devices, or in an emulator?

copper owl
#

Haven't tested in other devices or emulator.

candid barn
#

This error seems to be about SSL certificates. Do you have any special configuration in your app for SSL certificates, or intercepting traffic for example?

copper owl
#

I don't have as far as i know. I also turned off VPN and whatnot in testing.

#

I am trying it out on emulator as well if i can replicate

tepid swanBOT
copper owl
#

emulator also has the same problem

#

Stripe Failed: IOException during API request to Stripe (https://api.stripe.com/v1/payment_intents/pi_3SVt2HFzcwMnw9IE1NDHtcR6/confirm): java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.. Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com.

This is the full error I got. I am using the same Wifi for both devices.

The version of the library i am using is stripeAndroid = "20.52.0"

wide vine
#

πŸ‘‹ taking over for my colleague. Let me catch up.

#

please give me a moment and I will be with you shortly

copper owl
#

ok

wide vine
#

you need to update the TLS config of your app

copper owl
#

Oh i see. What kind of update do i need to add? do we include stripe in the subdomains?

wide vine
#

which SDK version are you using?

copper owl
#

20.52.0

wide vine
copper owl
#

I can try this then see if the Cert error still exist?

wide vine
#

yes please

#

and if you can try to upgrade to more recent versions I think it would probably be for the best

copper owl
#

give me a few moments though, i will get back to you on the library upgrade. just need to iron out some things on my side

tepid swanBOT
copper owl
#

ok i am currently building now wiht 20.53.0

copper owl
#

So i upgraded to 20.53.0 and still it didn't work

vocal garden
#

πŸ‘‹ Hey, taking over here, just taking a look. Is it still the same error?

copper owl
#

yes

tepid swanBOT
copper owl
#

any insight what i can do to fix this?

kind blade
#

Hi there, taking over for @vocal garden as they had to step away, they weren't able to identify the issue so I'll start looking into this

copper owl
#

oh thank you

#

so yeah, upgraded my SDK and still getting the error

kind blade
#

Earlier it was mentioned that you need to update the TLS config of your app. Did you make any changes there?

copper owl
#

not yet

#

I don't know what to change for it

kind blade
#

Got it, reaching out to my colleagues to get the details on this

copper owl
#

<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">api.xxx.com</domain>
<domain includeSubdomains="true">media.xxx.com</domain>
<domain includeSubdomains="true">xxx.com</domain>
</domain-config>
</network-security-config>

I censored the xxx since it is the name of the company. hope you don't mind.

candid barn
#

Thanks! That seems fine

copper owl
#

ok, can i bring up one thing we were able to do to make it work

#

somehow if i go close the application and go back to the same page where i do the stripe operation, it will work

#

Like full close remove from drawer

#

Or at least it worked twice.

candid barn
#

Interesting. So it could be the case that some code elsewhere in the app is interfering with how network connections are made

#

I think I asked earlier, but do you have any custom SSL-related code in your app? Like a TrustManager or any code that looks like that?

#

Also, you mentioned this error: "Stripe Failed: IOException during API request to Stripe" β€” are you able to print out the entire stacktrace here?

copper owl
#

ah sure. While i print stack trace, is it fine to send recording of the situation?

candid barn
#

Sure!

copper owl
#

Just to explain the video, I am testing using 2c2p and stripe. What i did was not proceed with 2c2p and try paying with stripe. As we investigate, we saw the Cert error.

Also when I mentioned we were able to make it work. Imagine after this video, i closed the app fully, go back to the same page and just pay with Stripe. That somehow fixes it

candid barn
#

That's good information, thanks. It looks like the 2c2p SDK has its own SSLSocketFactory, which could potentially affect how SSL connections are made throughout the app

copper owl
#

Ok, one thing i theorised with this is that i can reinitialise the PaymentConfiguration like this when the 2c2p operation is done. Would that reset the SSL stuff?

PaymentConfiguration.init(requireContext(), stripeWrapper.getPublishableKey())

candid barn
#

I don't think so

#

Do you know which version of the 2c2cp SDK you have?

copper owl
#

pgwUiSdk = "4.0.4"

It is pgwUiSdk btw

#

not directly 2c2p i guess but yeah

tepid swanBOT
candid barn
#

Yeah, I can see that it imports version 4.7.1 of the pgw-sdk, which looks like it overrides the default SSL socket factory used by the app

#

So it appears that their SDK is causing problems for others

copper owl
#

ah sorry what do you mean? the 4.0.4 version of the library gets the 4.7.1 version of what exactly?

candid barn
copper owl
#

ah got it. the UI sdk i am using is using their latest SDK which has a bug with SSL?

candid barn
#

It's hard to tell, as they don't publish the source code of this SDK. But from a quick look inside, it seems that they override the code to handle SSL/TLS connections. They seem to be calling HttpsURLConnection.setDefaultSSLSocketFactory(…) which may affect how any other code in your app creates a secure HTTP connection.

#

So you'd have to talk to them about this

copper owl
#

Ah ok, let me verify this as well. If i full close the app now, the SSL default factory should reset. I should be able to buy via stripe no problem in theory

candid barn
#

Potentially. It depends at which point the relevant 2c2p code gets initialised

copper owl
#

Yeah, it worked. Your theory sounds correct

#

I guess if i can reset it, that should solve it or maybe just ask them how to reset this on their library itself

candid barn
#

You can try something like HttpsURLConnection.setDefaultSSLSocketFactory(null) but honestly that's just a guess, and again it depends on how they override this

#

You'd need to follow up with them πŸ™‚

copper owl
#

BTW, may i ask where did you find the quick look inside. I wanna also see what they did

#

HttpsURLConnection.setDefaultSSLSocketFactory(…) <-- how they set this, do oyu have a link?

candid barn
copper owl
#

got it. Thank you very much