Docker. Ошибки PCSCD
Добрый день!
Решили протестировать работу ЕГАИС в контейнере. Версии установленного ПО и ОС в контейнере:
Linux test 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
Package: libccid
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 570
Maintainer: Ludovic Rousseau <rousseau@debian.org>
Architecture: i386
Source: ccid
Version: 1.4.34-1
Provides: pcsc-ifd-handler
Depends: libc6 (>= 2.15), libusb-1.0-0 (>= 2:1.0.9)
Suggests: pcmciautils
Package: libpcsclite1
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 105
Maintainer: Ludovic Rousseau <rousseau@debian.org>
Architecture: i386
Multi-Arch: same
Source: pcsc-lite
Version: 1.9.1-1
Depends: libc6 (>= 2.28)
Suggests: pcscd (= 1.9.1-1)
Breaks: libpcsclite-dev (<< 1.9.1-1), pcscd (<< 1.9.1-1)
Package: pcscd
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 214
Maintainer: Ludovic Rousseau <rousseau@debian.org>
Architecture: i386
Multi-Arch: foreign
Source: pcsc-lite
Version: 1.9.1-1
Depends: libccid (>= 1.4.1~) | pcsc-ifd-handler, libc6 (>= 2.15), libsystemd0, libudev1 (>= 183), lsb-base (>= 3.0-6), libpcsclite1 (= 1.9.1-1)
Pre-Depends: init-system-helpers (>= 1.54~)
Suggests: systemd
Package: pcsc-tools
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 587
Maintainer: Ludovic Rousseau <rousseau@debian.org>
Architecture: i386
Version: 1.5.7-1
Depends: libc6 (>= 2.4), libpcsclite1 (>= 1.3.0), libpcsc-perl
Recommends: libgtk3-perl
Package: opensc
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 1609
Maintainer: Debian OpenSC Maintainers <pkg-opensc-maint@lists.alioth.debian.org>
Architecture: i386
Multi-Arch: foreign
Version: 0.21.0-1
Depends: opensc-pkcs11 (= 0.21.0-1), libc6 (>= 2.7), libreadline8 (>= 6.0), libssl1.1 (>= 1.1.1), zlib1g (>= 1:1.1.4)
Recommends: pcscd
Conflicts: mozilla-opensc
libusb-0.1-4:i386 2:0.1.12-32 i386 userspace USB programming library
libusb-1.0-0:i386 2:1.0.24-3 i386 userspace USB programming library
libusb-dev 2:0.1.12-32 i386 userspace USB programming library development files
Токен пробрасывается в контейнер следующим образом:
volumes:
- /dev/bus/usb:/dev/bus/usb
- /run/udev:/run/udev
В процессе работы с какой-то периодичностью на веб морде ЕГАИС показывает, что не видит сертификаты на токене . В логах PCSCD видим следующую ошибку (LIBUSB_ERROR_TIMEOUT):
00000004 ifdhandler.c:1332:IFDHTransmitToICC() usb:0a89/0030:libudev:0:/dev/bus/usb/003/004 (lun: 0)
00031417 SW: 90 00
00000009 winscard.c:1648:SCardTransmit() UnrefReader() count was: 2
00000003 winscard_svc.c:691:ContextThread() TRANSMIT rv=0x0 for client 12
00000210 winscard_svc.c:361:ContextThread() Received command: TRANSMIT from client 12
00000009 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
00000002 winscard.c:1595:SCardTransmit() Send Protocol: T=1
00000004 APDU: 00 2A 9E 9A 01 00 00
00000003 ifdhandler.c:1332:IFDHTransmitToICC() usb:0a89/0030:libudev:0:/dev/bus/usb/003/004 (lun: 0)
04372739 ccid_usb.c:897:ReadUSB() read failed (3/4): -7 LIBUSB_ERROR_TIMEOUT
00000183 SW:
00000063 ifdwrapper.c:543:IFDTransmit() Card not transacted: 612
00000055 winscard.c:1620:SCardTransmit() Card not transacted: 0x80100016
00000051 winscard.c:1648:SCardTransmit() UnrefReader() count was: 2
00000052 winscard_svc.c:691:ContextThread() TRANSMIT rv=0x80100016 for client 12
00000138 winscard_svc.c:361:ContextThread() Received command: TRANSMIT from client 12
00000089 readerfactory.c:852:RFReaderInfoById() RefReader() count was: 1
00000057 winscard.c:1595:SCardTransmit() Send Protocol: T=1
00000052 APDU: 80 40 00 00 00
В логах ЕГАИС:
ERROR ru.centerinform.transport.backbone.schedule.Receiver - [RESTful] Ошибка при получении документов с сервера
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://exchanger-nd.utm.egais.ru:6443/ … 0000635476": java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR; nested exception is javax.net.ssl.SSLException: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:784)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:710)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:601)
at ru.centerinform.transport.rest.sender.RestReceiver.a(RestReceiver.java:278)
at ru.centerinform.transport.backbone.schedule.Receiver.b(Receiver.java:764)
at ru.centerinform.transport.backbone.schedule.WSExchangeJob.execute(WSExchangeJob.java:1080)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: javax.net.ssl.SSLException: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
at sun.security.ssl.Alert.createSSLException(Alert.java:133)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:370)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:313)
at sun.security.ssl.TransportContext.fatal(TransportContext.java:308)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1504)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:432)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:389)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:87)
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:775)
... 7 common frames omitted
Caused by: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
at sun.security.pkcs11.P11Signature.engineSign(P11Signature.java:617)
at java.security.Signature$Delegate.engineSign(Signature.java:1382)
at java.security.Signature.sign(Signature.java:698)
at sun.security.ssl.CertificateVerify$T12CertificateVerifyMessage.<init>(CertificateVerify.java:609)
at sun.security.ssl.CertificateVerify$T12CertificateVerifyProducer.produce(CertificateVerify.java:761)
at sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:420)
at sun.security.ssl.ServerHelloDone$ServerHelloDoneConsumer.consume(ServerHelloDone.java:182)
at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:376)
at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:479)
at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:457)
at sun.security.ssl.TransportContext.dispatch(TransportContext.java:200)
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:155)
at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1320)
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1233)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:417)
... 23 common frames omitted
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
at sun.security.pkcs11.wrapper.PKCS11.C_Sign(Native Method)
at sun.security.pkcs11.wrapper.PKCS11$SynchronizedPKCS11.C_Sign(PKCS11.java:1770)
at sun.security.pkcs11.P11Signature.engineSign(P11Signature.java:608)
... 37 common frames omitted
С чем может быть связана данная проблема?