usingcamerafromwebview
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| usingcamerafromwebview [2023/04/13 11:24] – [Found facts and solution] kalaschnikow | usingcamerafromwebview [2023/04/18 12:05] (current) – [Using Camera from WebView] kalaschnikow | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Using Camera from WebView ====== | ||
| + | The task is: | ||
| + | * find out whether/how it is possible to use (hardware) camera from the web control | ||
| + | |||
| + | |||
| + | Marcel means it would be possible, when we use HTTPS for communication between our server and mobile client. The question is to: | ||
| + | * find out whether is possible | ||
| + | * test it | ||
| + | * use certificates properly | ||
| + | * find out how we can use the " | ||
| + | |||
| + | So: | ||
| + | * 1. find out how to use the camera | ||
| + | * HTTPS only? | ||
| + | * 2. use HTTPS ? | ||
| + | * 3. use certificates properly | ||
| + | |||
| + | |||
| + | ===== Current status ===== | ||
| + | * the HTTPS is implemented and can be used | ||
| + | * my work is saved in special branches (see the following text) | ||
| + | * I wrote a document about using HTTPS with efc ERP: | ||
| + | * https:// | ||
| + | * currently (18.04.2023) : | ||
| + | * I can leave my work "as is" (saved in branches and documented in the previously described document) and wait until Marcel will implement certificate handling in the Tomcat | ||
| + | * Marcel (maybe) will implement a " | ||
| + | ===== Found facts and solution ===== | ||
| + | |||
| + | * I wrote a document about using HTTPS with efc ERP: https:// | ||
| + | |||
| + | * to use camera from WebView all communication should be done over HTTPS | ||
| + | * to scan barcodes we can use a library for it | ||
| + | * we chose zxing | ||
| + | * see '' | ||
| + | ... | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | </ | ||
| + | | ||
| + | * to enable scanner the parameter '' | ||
| + | * I've tested it in the file '' | ||
| + | < | ||
| + | </ | ||
| + | * for test purposes an " | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | * my work is saved in two branches | ||
| + | * '' | ||
| + | * for project '' | ||
| + | * '' | ||
| + | * for projects | ||
| + | * '' | ||
| + | * '' | ||
| + | ===== Reading Bar code ===== | ||
| + | The following bar codes should be supported (sorted by priority): | ||
| + | |||
| + | * Code39 | ||
| + | * EAN13 | ||
| + | * DataMatrix | ||
| + | * QRCode | ||
| + | * PDF417 | ||
| + | * Code128 | ||
| + | |||
| + | See also the email from Klaus Gebauer " | ||
| + | |||
| + | I found the following libraries: | ||
| + | * https:// | ||
| + | * based on [[https:// | ||
| + | * supported bar codes are listed here: https:// | ||
| + | * https:// | ||
| + | * based on [[https:// | ||
| + | |||
| + | ===== Misc ===== | ||
| + | |||
| + | * To have the " | ||
| + | * Open view " | ||
| + | * Open project '' | ||
| + | * Open folder '' | ||
| + | * Execute task '' | ||
| + | |||
| + | * TODO | ||
| + | * the ng-component efc-field is not yet "bug free". There is a small CSS-problem with scanner symbol, which should be fixed. | ||
| + | * see https:// | ||
| + | * ask Torsten where / how to do it | ||
| + | * clean | ||
| + | * documentation/ | ||
| + | |||
| + | |||
| + | * A very helpful tool to debug in Chrome is the " | ||
| + | * see also : [[https:// | ||
| + | * to check devices in Chrome: '' | ||
| + | | ||
| + | * Icons library used by '' | ||
| + | * This is the [[https:// | ||
| + | |||
| + | * Show Corners / Get coordinates of barcode | ||
| + | * https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | ==== Settings ==== | ||
| + | |||
| + | |||
| + | * On Eclipse project '' | ||
| + | * Open context menu and ' | ||
| + | * Open " | ||
| + | * Add one entry: | ||
| + | * Source '' | ||
| + | * In the file '' | ||
| + | * edit entry ''" | ||
| + | * to ''" | ||
| + | ===== Useful reading ===== | ||
| + | * Let's Encrypt for intranet servers | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | * Using WebView with HTTPS | ||
| + | * Our [[https:// | ||
| + | * https:// | ||
| + | * HTTPS should work with standard WebView (?) | ||
| + | * [[https:// | ||
| + | * Proper solution (?) | ||
| + | * https:// | ||
| + | * is it a workaround? | ||
| + | |||
| + | * [[https:// | ||
| + | * add parameters " | ||
| + | * [[https:// | ||
| + | ==== SSL/TLS Configuration How-To (for Apache Tomcat 9.0) ==== | ||
| + | |||
| + | Original: [[https:// | ||
| + | |||
| + | === SSL/TLS and Tomcat === | ||
| + | |||
| + | * It is important to note that configuring Tomcat to take advantage of secure sockets is usually only necessary when running it as a stand-alone web server. | ||
| + | |||
| + | === Certificates === | ||
| + | * Certificate - " | ||
| + | * Organization and some contact information | ||
| + | * This certificate is cryptographically signed by its owner | ||
| + | * For the certificate to work in the browsers without warnings, it needs to be signed by a trusted | ||
| + | * To obtain a signed certificate, | ||
| + | * A range of CAs is available including some that offer certificates at no cost. | ||
| + | * Java provides a simple command-line tool '' | ||
| + | * Self-signed Certificates not really guaranteed to be authentic at all, but can be useful for some testing scenarios (=> they are not suitable for any form of production use). | ||
| + | |||
| + | === General Tips on Running SSL === | ||
| + | |||
| + | ... | ||
| + | |||
| + | === Configuration === | ||
| + | |||
| + | == Prepare the Certificate Keystore == | ||
| + | |||
| + | Tomcat currently operates only on keystores in following formats: | ||
| + | * JKS -> standard Java format (can be manipulated by '' | ||
| + | * PKCS11 or PKCS12 -> internet standard (can be manipulated via (among other things) OpenSSL and Microsoft' | ||
| + | |||
| + | To create a keystore with '' | ||
| + | < | ||
| + | " | ||
| + | </ | ||
| + | |||
| + | == Edit the Tomcat Configuration File == | ||
| + | |||
| + | Tomcat can use three different implementations of SSL: | ||
| + | * JSSE implementation provided as part of the Java runtime | ||
| + | * JSSE implementation that uses OpenSSL | ||
| + | * APR implementation, | ||
| + | |||
| + | ... | ||
| + | |||
| + | The final step is to configure the Connector in the '' | ||
| + | < | ||
| + | <!-- Define an SSL Coyote HTTP/1.1 Connector on port 8443 --> | ||
| + | < | ||
| + | protocol=" | ||
| + | port=" | ||
| + | scheme=" | ||
| + | keystoreFile=" | ||
| + | clientAuth=" | ||
| + | </ | ||
