PostGraphile v4.9.2 server listening on port 5001
‣ GraphQL API: http://0.0.0.0:5001/graphql
how can i change http to https. i mean, i want https://0.0.0.0:5001/graphql
because, i am getting error while debugging my ionic capacitor app for android
E/Capacitor/Console: File: http://localhost/vendor-es2018.js - Line 41539 -
Msg: ERROR Error: Http failure response for http:// mydomain .com:5001/graphql: 0 Unknown Error
i think it is about http problem but as you see it is unknown error. Thanks in advance
i found the solution here: How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?
i allowed http requests in manifest.xml and i added networkSecurityConfig.xml
Thank you all
Related
Problem
I'm trying to stream a m3u8 file in a react native app (for android TV) and I'm getting this error:
LOG {"error": {"errorCode": "22004", "errorException": "com.google.android.exoplayer2.ExoPlaybackException: Source error", "errorStackTrace": "com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:329)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:99)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.open(DataSourceInputStream.java:62)
at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:174)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
", "errorString": "ExoPlaybackException: ERROR_CODE_IO_BAD_HTTP_STATUS"}}
I don't know java so from the above traceback I'm guessing that the server is responding with an HTTP 403 and therefore it is unable to stream the file.
What I've tried
This one is not much of a solution but I tried switching to the react-native-video-player instead of react-native-video but that didn't work.
I tried passing the type: 'm3u8' and type: 'hls' inside the source attribute of the video tag along with the uri and this didn't help at all.
Tried to check if another m3u8 url (i.e. from another domain/server) is working, and it is working.
Downgrading react-native-video version, problem persists with different error message.
I decided to ssh into my android TV and directly use curl to fetch the m3u8 file and it responds with this:
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Moreover, many of the issues I found on github having a similar problem contain a URL that gives the same response when fetched directly with curl. Interestingly, if I use the fetch API in JS to console log the response from the m3u8 url, it works perfectly. So I'm guessing the problem is somewhere in exoplayer.
Specs
react-native : 'npm:react-native-tvos#0.69.6-0'
react-native-video : '^6.0.0-alpha.3'
Android TV : Tested both on a Raspberry Pi running Android TV (LineageOS I think) and an actual android tv set top box with same results.
The issue was with the user-agent header, exoplayer was setting a user-agent which was causing an HTTP 403. I had to use a proxy to figure this out and still have no clue as per why android studio was not showing the request that had an error.
I'm using volley in my app and send request to my server but i got this error from my onErrorResponse volley:
Error: com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: Read error: ssl=0xb4000071bca8e448: Failure in SSL library, usually a protocol error
error:10000438:SSL routines:OPENSSL_internal:TLSV1_ALERT_INTERNAL_ERROR (external/boringssl/src/ssl/tls_record.cc:587 0xb4000071bca09588:0x00000001)
I'm using device with android 11 and the request does not work what should i do?
Make sure you have connected to wifi
My code was working fine and I received data from the server but suddenly I got this error :
javax.net.ssl.SSLException: Read error: ssl=0x717c368708: I/O error during system call, Connection reset by peer
also sometimes I got this error :
com.google.gson.stream.MalformedJsonException:
Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
I'm using retrofit
implementation 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
and here is the init for it
Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl).
addConverterFactory(GsonConverterFactory.create()).build();
Api api = retrofit.create(Api.class);
Call<ProfileResult> profileCallBack = api.getProfileData();
I found the problem was in my ISP which redirects me to their website for displaying a message about internet consumption and stuck in that redirect, when I run the application using data or different WiFi it works fine!
we are trying to connect to an ipv6 local server address. This is the code snippet
_st := IdHTTP1.Get('http://[fe80::a6ee:57ff:fe5c:7de6]:8000/reparti');
The issue is the following:
If we compile for Windows -> It works and we get the json response
if we compile for either Android or iOS -> we get
"socket error #22 invalid argument"
and no response and the server do not receive any request
What are we missing?
Thank you for the support
The IP address you are attempting to connect to is incomplete. It is missing the mandatory scope ID.
I want to make volley https request, and I have use code from here to remove SSL3 protocol and using TLSv1.2 for android >=4.4 and TLS for Android<4.4, but sometimes when I make request this error appear :
javax.net.ssl.SSLHandshakeException:
javax.net.ssl.SSLProtocolException: SSL handshake terminated:
ssl=0x606cfb30: Failure in SSL library, usually a protocol error
error:1409443E:SSL routines:SSL3_READ_BYTES:tlsv1 alert inappropriate
fallback (external/openssl/ssl/s3_pkt.c:1256 0x5fee2098:0x00000003)
anybody can help ?
Note : That error only appear in some device with Android 4.4, some other device with Android 4.4 is working well without that error.
Finally, I found it by myself, that just the problem when using slow connection, so when the connection timeout volley handshake will failed (volley connection time out is so fast), so I try to added Volley time out to 10000 ms, like this :
jsonRequest.setRetryPolicy(new DefaultRetryPolicy(10000,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
And now my app working in device that use slow connection too.