-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request hangs when using a Self-Signed certificate #99
Comments
Hi, It looks like there is no way to set the default OkHttp hostnameVerifier/sslSocketFactory, so you would sadly have to fork the repo indeed. I'm open for PR's on it though. |
I just had a go at applying a quick and dirty patch to see if it would even work and I came across a few fatal errors with This might be above my head as I'm very new to NativeScript and still not familiar with its conventions. Here is the patch I was trying if anyone else comes across this ticket and has more of an idea how to get it working. It's a hack, not production ready.
|
You probably do not want to patch the source code in the repo since you can't use that directly in your project. How that would work is that you edit the java in the package in node_modules and when you have a working version you execute |
Normally you would be correct, but the published module doesn't include the Java sources. I could patch in the whole aar file but that's not even building.
Like I said; this is probably a trivial fix for someone who is comfortable with NativeScript and Java. I just don't know how it all fits together. |
Ah yeah, you're right :( It generates an aar file. I haven't done anything with NS for a while so not sure why it's not building, could have to do with the NS version that you have. |
I could reproduce this with the latest NS CLI version. It sounds like the fix would be to ship the sources, and not the aar file, and not do the build before shipping, however I have never tried that, I have to schedule some time to fix the build process for the NS 8 version. |
@Omnomios I have just published version 3.0.4 to npm, can you see if that works for you? (I don't have time to test it right now) That also makes it easier for you to patch the java files. |
That's amazing! 🎉 |
Thanks for testing that out! I have just pushed the changes :) |
Would love to. I'll have a look over it on the weekend. |
Is there any update on this? I made the changes directly to that code, but the build of the package itself does not work on my machine. Probably because of that latest Node and Angular version. |
I now made pull requests about this problem |
NativeScript: 8.3.3
Android: v13 on Pixel 7
I have been using a self signed cert on Android for development successfully by a using a void trust manager. Setting
HttpsURLConnection.setDefaultSSLSocketFactory
seems to work with the core Http library.When I switch over to
@klippa/nativescript-http
all requests hang indefinitely when making requests to the development server that uses a self signed certificate. I switch it back to the production server and everything works as expected.Is there a way to set
sslSocketFactory
to a void trust manager on the OKHttp builder from within Javascript or is the only option to fork this repo and patch it for my own use case?The text was updated successfully, but these errors were encountered: