-
Notifications
You must be signed in to change notification settings - Fork 32
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
CBL Local server responds "cors":"rejected" on https/http mode. #78
Comments
@hideki trying to achieve this below.. pls share your thoughts? |
Hi @NitzDKoder, |
@hideki didnt find much on this.. on below use case we see cros issue. NON- HTTPS CBL listener; @pasin pls share your thoughts on this.. |
@hideki thanks for the inputs.. "I believe you are using latest CBL v1.3.1 or build from the master branch which uses OkHttp. And you refer 1.2 documentation for SSL. CBL 1.2.x or earlier uses HttpClient. I verified 1.2.x works with SSL. So far, I have not verified if SSL works with 1.3.x or higher. "cors":"rejected" issue might be caused by OkHttp and tjws combination??" We are using 1.3.1 CBL + okhttp + TJWS.. have not tried in 1.2.x Thanks |
@hideki we found the issue.. Basically its not cors issue here.. Problem:
need to check the reason yet why true always. 4)As the server was not started and statusCode was 0. CORS was detected.
Pls share your thoughts.. Solution: Make sure server is started and running and then make request. Thanks |
@NitzDKoder, |
@hideki pls ignore previous problem statement.. Sever gets up immediately after start. New problem statement.
4)All our requests are treated as is_crossDomain true With above 3 problem response statusCode was 0 , CORS was detected. Use case 2:
3)Server was able to parse the request and respond to 200 ok.
android:debuggable="true" vs android:debuggable="false" is making server socket to behave differently. Pls share your thoughts.. Thanks |
Honestly, I don't know how https://developer.android.com/guide/topics/manifest/application-element.html#debug |
@hideki this answere.. |
Hi @NitzDKoder, |
@hideki yes release android with cordova based app will not work with self singed certificate. Thanks |
@NitzDKoder, I believe that certification verification should be provided by Android (JRE). And TJWS just uses it. Valid certificate should work fine. https://developer.android.com/training/articles/security-ssl.html |
@hideki But we have android webview throwing CN validation issue.(ERR_CERT_COMMON_NAME_INVALID ) Local server URL: https://localhost:18641/data The common name represents the name protected by the SSL certificate. The certificate is valid only if the request hostname matches the certificate common name. https://support.dnsimple.com/articles/what-is-common-name/ Pls share your thoughts... Thanks |
Hi @NitzDKoder, |
@hideki Here the browser is the client and doing ssl stuffs and throwing the error, so you are saying to add hook at cordova? Thanks |
@NitzDKoder, As the error occurs in the browser, so replacing SSLFactory in CBL does not solve the problem. |
Ok thanks.. Design: Cordoava based android app. https://github.com/couchbase/couchbase-lite-ios/wiki/LiteServ-With-SSL https://github.com/couchbaselabs/TodoLite-PhoneGap/blob/master/js/modules.js Android Browser/JavaScript doing xhr https REST requests done to TJWS(java sever with official certificate applied ) and getting SSL error. Thanks |
@hideki tweaked cordova to ignore hostname verification. Things are ok now. Will update more soon. |
Hi Folks,
https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin
2)When applied HTTPS to local server as per below link
https://developer.couchbase.com/documentation/mobile/1.2/develop/guides/couchbase-lite/tech-notes/p2p-replications-ssl/index.html
4)Router code needs this change? Yet to do this change.
https://forums.couchbase.com/t/cannot-connect-to-db-lite-couchbase-on-ios-10/10318/6
https://github.com/couchbase/couchbase-lite-java-core/blob/8817e7976427824dcaea5e8687ce20b29cc6e94b/src/main/java/com/couchbase/lite/router/Router.java#L417
PS: Http mode works well.
Thanks
Nithin
The text was updated successfully, but these errors were encountered: