phatpaul opened a new issue #1296:
URL: https://github.com/apache/cordova-android/issues/1296


   # Bug Report
   
   ## Problem
   
   New forced https:// scheme is incompatible with unsecure APIs.
   
   I think there should be an option to use http:// scheme. 
    (file:// scheme works OK on newer Android devices, but causes issues with 
loading ES6 modules on older devices)
   
   ### What is expected to happen?
   Upgraded Cordova should continue to connect to devices over http: and ws:
   
   ### What does actually happen?
   Unable to connect to unsecure HTTP API or websocket.
   ```
   Error: DOMException: Failed to construct 'WebSocket': An insecure WebSocket 
connection may not be initiated from a page loaded over HTTPS.
   Mixed Content: The page at 'https://localhost/index.html' was loaded over 
HTTPS, but attempted to connect to the insecure WebSocket endpoint 
'ws://192.168.33.144/websocket/ws.cgi'. This request has been blocked; this 
endpoint must be available over WSS.
   ```
   
   ## Information
   
   ### Command or Code to reproduce issue
   Upgrade cordova-android platform to 10.0.
   
   ```
   ws = new WebSocket("ws://192.168.33.144")
   Mixed Content: The page at 'https://localhost/index.html' was loaded over 
HTTPS, but attempted to connect to the insecure WebSocket endpoint 
'ws://192.168.33.144/'. This request has been blocked; this endpoint must be 
available over WSS.
   VM1019:1
   DOMException: Failed to construct 'WebSocket': An insecure WebSocket 
connection may not be initiated from a page loaded over HTTPS.
   ```
   
   ```
   fetch("http://192.168.33.144";)
   Mixed Content: The page at 'https://localhost/index.html' was loaded over 
HTTPS, but requested an insecure resource 'http://192.168.33.144/'. This 
request has been blocked; the content must be served over HTTPS.
   ```
   
   ### Environment, Platform, Device
   Cordova app is connecting to a ESP32 webserver via encrypted WiFi.  (not on 
the internet)  There shouldn't be a need to upgrade the ESP32 firmware to 
support HTTPS (and even if I did, would a self-signed SSL cert work?)
   
   ### Version information
   Cordova: Cordova 10.0
   Cordova Platforms: Cordova-Android 10.0
   Other Frameworks: none.
   Operating System: Win 7 x64
   Android Studio 4.2.2
   Android 10 on Moto Stylus G
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x ] I searched for existing GitHub issues
   - [x ] I updated all Cordova tooling to most recent version
   - [x ] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to