sane-escl: canon pixma ts5350, "invalid argument" when using default HTTPS on port 443
System Info
- OS: Arch Linux
- Sane version: (sane-backends) 1.4.0; backend version 1.4.0
- Printer: Canon PIXMA TS5350
Issue
The default device added by sane-escl is failing to scan with an "invalid argument" / SSL connection error. It seems that the printer does not support HTTPS / port 443 / SSL?
Note: I also tried HTTP on port 443, e.g. escl:http://192.168.178.48:443 since that is the URL avahi reports for "uscans._tcp", but I get an empty response.
Workaround
Scanning works if I manually use HTTP on port 80. If using escl.conf I have to add the entry by something else than IP, e.g. hostname:
# escl.conf
device http://05FE42000000.local:80 "Canon Pixma TS5350"
However my scanning GUI front-end (GNOME simple-scan) also picks up the default non-working https from sane-escl so I end up having 2 devices of which the first in the list does not work.
Logs
scanimage
❯ SANE_DEBUG_ESCL=128 scanimage -L
[12:10:51.778069] [sanei_debug] Setting debug level of escl to 128.
[12:10:51.778101] [escl] escl sane_init
[12:10:51.778133] [escl] escl sane_get_devices
# ...
[12:10:51.817223] [escl] resolve_callback []
[12:10:51.817240] [escl] escl_device_add
[12:10:52.790147] [escl] Escl add device : https://192.168.178.48:443
device `v4l:/dev/video0' is a Noname hama C-600 Pro Webcam: hama C-6 virtual device
device `escl:https://192.168.178.48:443' is a Canon TS5300 series platen scanner
[12:10:55.128634] [escl] escl sane_exit
HTTPS on Port 443 (default: escl auto-detect)
❯ SANE_DEBUG_ESCL=128 scanimage --device "escl:https://192.168.178.48:443" --format=pdf --output-file test.pdf --progress --verbose
[12:19:11.916813] [sanei_debug] Setting debug level of escl to 128.
[12:19:11.916846] [escl] escl sane_init
[12:19:11.917358] [escl] escl sane_open
[12:19:11.917367] [escl] escl_parse_name
[12:19:11.917385] [escl] _get_blacklist_pdf: finish
[12:19:11.917401] [escl] escl_curl_url: URL: https://192.168.178.48:443/eSCL/ScannerCapabilities
[12:19:11.917408] [escl] Before use hack
[12:19:11.917414] [escl] After use hack
[12:19:11.917419] [escl] Ignoring safety certificates, use https
[12:19:12.046574] [escl] The scanner didn't respond: SSL connect error
scanimage: open of device escl:https://192.168.178.48:443 failed: Invalid argument
[12:19:12.046630] [escl] escl sane_exit
HTTP on Port 443
❯ SANE_DEBUG_ESCL=128 scanimage --device "escl:http://192.168.178.48:443" --format=pdf --output-file test.pdf --progress --verbose
[12:43:54.386866] [sanei_debug] Setting debug level of escl to 128.
[12:43:54.386900] [escl] escl sane_init
[12:43:54.387411] [escl] escl sane_open
[12:43:54.387420] [escl] escl_parse_name
[12:43:54.387441] [escl] _get_blacklist_pdf: finish
[12:43:54.387457] [escl] escl_curl_url: URL: http://192.168.178.48:443/eSCL/ScannerCapabilities
[12:43:54.387464] [escl] Before use hack
[12:43:54.387471] [escl] After use hack
[12:43:54.497339] [escl] The scanner didn't respond: Server returned nothing (no headers, no data)
scanimage: open of device escl:http://192.168.178.48:443 failed: Invalid argument
[12:43:54.497420] [escl] escl sane_exit
HTTP on Port 80 (works)
❯ SANE_DEBUG_ESCL=128 scanimage --device "escl:http://192.168.178.48:80" --format=pdf --output-file test.pdf --progress --verbose
[12:53:51.792119] [sanei_debug] Setting debug level of escl to 128.
[12:53:51.792153] [escl] escl sane_init
[12:53:51.792661] [escl] escl sane_open
[12:53:51.792668] [escl] escl_parse_name
[12:53:51.792683] [escl] _get_blacklist_pdf: finish
[12:53:51.792704] [escl] escl_curl_url: URL: http://192.168.178.48:80/eSCL/ScannerCapabilities
[12:53:51.792710] [escl] Before use hack
[12:53:51.792716] [escl] After use hack
[12:53:51.964765] [escl] Create NewJob : the scanner header responded : [HTTP/1.1 200 OK
MIME-Version: 1.0
Transfer-Encoding: chunked
Content-Type: text/xml
Connection: close
]
[12:53:51.964801] [escl] XML Capabilities[
# ... snipped ..
]
avahi
❯ avahi-browse -rt _uscan._tcp
+ wlan0 IPv6 Canon TS5300 series _uscan._tcp local
+ wlan0 IPv4 Canon TS5300 series _uscan._tcp local
= wlan0 IPv6 Canon TS5300 series _uscan._tcp local
hostname = [05FE42000000.local]
address = [192.168.178.48]
port = [80]
txt = ["usb_MFG=Canon" "mopria-certified-scan=1.2" "duplex=F" "is=platen" "cs=grayscale,color" "rs=eSCL" "representation=http://05FE42000000.local./icon/printer_icon.png" "vers=2.63" "UUID=00000000-0000-1000-8000-00188b0fb3d8" "adminurl=http://05FE42000000.local./index.html?page=PAGE_AAP" "note=" "pdl=image/jpeg,application/pdf" "ty=Canon TS5300 series" "txtvers=1"]
= wlan0 IPv4 Canon TS5300 series _uscan._tcp local
hostname = [05FE42000000.local]
address = [192.168.178.48]
port = [80]
txt = ["usb_MFG=Canon" "mopria-certified-scan=1.2" "duplex=F" "is=platen" "cs=grayscale,color" "rs=eSCL" "representation=http://05FE42000000.local./icon/printer_icon.png" "vers=2.63" "UUID=00000000-0000-1000-8000-00188b0fb3d8" "adminurl=http://05FE42000000.local./index.html?page=PAGE_AAP" "note=" "pdl=image/jpeg,application/pdf" "ty=Canon TS5300 series" "txtvers=1"]
❯ avahi-browse -rt _uscans._tcp
+ wlan0 IPv6 Canon TS5300 series _uscans._tcp local
+ wlan0 IPv4 Canon TS5300 series _uscans._tcp local
= wlan0 IPv6 Canon TS5300 series _uscans._tcp local
hostname = [05FE42000000.local]
address = [192.168.178.48]
port = [443]
txt = ["usb_MFG=Canon" "mopria-certified-scan=1.2" "duplex=F" "is=platen" "cs=grayscale,color" "rs=eSCL" "representation=http://05FE42000000.local./icon/printer_icon.png" "vers=2.63" "UUID=00000000-0000-1000-8000-00188b0fb3d8" "adminurl=http://05FE42000000.local./index.html?page=PAGE_AAP" "note=" "pdl=image/jpeg,application/pdf" "ty=Canon TS5300 series" "txtvers=1"]
= wlan0 IPv4 Canon TS5300 series _uscans._tcp local
hostname = [05FE42000000.local]
address = [192.168.178.48]
port = [443]
txt = ["usb_MFG=Canon" "mopria-certified-scan=1.2" "duplex=F" "is=platen" "cs=grayscale,color" "rs=eSCL" "representation=http://05FE42000000.local./icon/printer_icon.png" "vers=2.63" "UUID=00000000-0000-1000-8000-00188b0fb3d8" "adminurl=http://05FE42000000.local./index.html?page=PAGE_AAP" "note=" "pdl=image/jpeg,application/pdf" "ty=Canon TS5300 series" "txtvers=1"]
Closing
I'm unsure if this is an escl, avahi, printer or me issue. Anyhow what would perhaps help already is an option in escl.conf to skip/hide/remove/... unwanted devices that get auto-detected, e.g.:
# escl.conf
# use skip=true, to not register this device
device https://192.168.178.48:443 "Somename" skip=true
Cheers and thank you!