Статус: Новичок
Группы: Участники
Зарегистрирован: 03.10.2022(UTC) Сообщений: 1
|
Добрый день! В мобильном приложении Android используется гост шифрование. Авторизация только на сервере. Клиент okhttp. Chromium Gost соединяется с сервером отлично и все работает хорошо. В мобильном приложении запросы валятся в хаотичном порядке. То подключается успешно, то выдает ошибку. Код.Код:
fun initCryptoPro() {
val init = CSPConfig.init(this)
check(init == CSPConfig.CSP_INIT_OK) { "CSPConfig.init failed" }
if (Security.getProvider(JCSP.PROVIDER_NAME) == null) Security.addProvider(JCSP())
if (Security.getProvider(Provider.PROVIDER_NAME) == null) Security.addProvider(Provider())
cpSSLConfig.setDefaultSSLProvider(JCSP.PROVIDER_NAME)
if (Security.getProvider(RevCheck.PROVIDER_NAME) == null) Security.addProvider(RevCheck())
//System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2")
System.setProperty("https.protocols", "TLSv1.2")
//System.setProperty("javax.net.debug", "ssl:handshake")
System.setProperty("javax.net.debug", "all")
System.setProperty("ru.CryptoPro.CAdES.validate_tsp", "false")
System.setProperty("com.sun.security.crl.timeout", "5")
System.setProperty("ru.CryptoPro.crl.read_timeout", "5")
System.setProperty("com.sun.security.enableCRLDP", "true")
System.setProperty("com.ibm.security.enableCRLDP", "true")
System.setProperty("disable_default_context", "true")
System.setProperty("ngate_set_jcsp_if_gost", "true")
System.setProperty("ru.CryptoPro.key_agreement_validation", "false")
System.setProperty("tls_prohibit_disabled_validation", "true")
}
fun test() {
initCryptoPro()
val data = getTrustManager(applicationInfo.dataDir)
testConnection(this, data.first, data.second)
}
fun getClient(dir: String, timeout: Long): OkHttpClient {
val sslInfo = getTrustManager(dir)
return OkHttpClient.Builder()
.connectTimeout(timeout, TimeUnit.SECONDS)
.followRedirects(true)
.retryOnConnectionFailure(true)
.sslSocketFactory(
sslInfo.first.socketFactory,
sslInfo.second
)
.connectionSpecs(
listOf(
ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions("TLSv1.2")
.cipherSuites("TLS_CIPHER_2012", "TLS_CIPHER_2001")
.build()
)
)
.build()
}
fun getTrustManager(dir: String): Pair<SSLContext, X509TrustManager>{
val trustManagers = arrayOfNulls<TrustManager>(1)
val path = dir + File.separator +
BKSTrustStore.STORAGE_DIRECTORY + File.separator +
BKSTrustStore.STORAGE_FILE_TRUST
val sslContext = TLSContext.initClientSSL(
Provider.PROVIDER_NAME,
"GostTLSv1.2",
BouncyCastleProvider.PROVIDER_NAME,
BKSTrustStore.STORAGE_TYPE,
FileInputStream(path),
String(BKSTrustStore.STORAGE_PASSWORD),
trustManagers
)
return Pair(sslContext, trustManagers[0] as X509TrustManager)
}
fun testConnection(activity: MainActivity, sslContext: SSLContext, trustManager: X509TrustManager) {
//val request = Request.Builder().url("<some url>").build()
getClient(activity.applicationInfo.dataDir, 60)
.newCall(request)
.enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
//Log.e("@@@@@", "", e)
}
override fun onResponse(call: Call, response: Response) {
//Log .w("@@@@@", response.body?.string().orEmpty())
}
})
}
Лог.
V/JCP: ru.CryptoPro.ssl.util.SecureChecker.checkPublicKeys :: Checking if every certificate has GOST algorithm... V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: enter V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Public key is trusted = true V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Import public key: 0000: 30 66 30 1F 06 08 2A 85 03 07 01 01 01 01 30 13 0f0...*.......0. 0010: 06 07 2A 85 03 02 02 24 00 06 08 2A 85 03 07 01 ..*....$...*.... 0020: 01 02 02 03 43 00 04 40 0E 8D DE BA 88 EF 08 AF ....C..@........ 0030: 6F 8D AB 35 9F 83 E3 BB BC AD D6 31 FF 91 E3 B6 o..5.......1.... 0040: 8C E4 07 D5 BD 10 7D 31 04 5F 32 69 CC CD A5 93 .......1._2i.... 0050: 8F 0C FA B6 5B 3B E0 09 56 04 71 4A F8 8A FA A9 ....[;..V.qJ.... 0060: 0F 68 BF 1C 54 1C 98 D1 .h..T... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapper.a :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key (from constructor)... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) => 3138895411 V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Trying to import the public key, object #0... V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.importKey :: [OkHttp https://<some_addr>/...] :: CryptImportKey(3138895411, [B@62aaff1, 0, 73728) => 3138886963 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138895411) for key: 3138886963 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138895411, 0), source = provider (after create/gen/derive/import/export) V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: The public key has been created. V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: exit V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: enter V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Public key is trusted = true V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Import public key: 0000: 30 66 30 1F 06 08 2A 85 03 07 01 01 01 01 30 13 0f0...*.......0. 0010: 06 07 2A 85 03 02 02 23 01 06 08 2A 85 03 07 01 ..*....#...*.... 0020: 01 02 02 03 43 00 04 40 2C 47 BD 79 50 82 DA 31 ....C..@,G.yP..1 0030: 15 EC BD 73 17 2C 83 18 3B 89 AD 4C 17 7B A1 42 ...s.,..;..L...B 0040: 2D D3 A6 85 88 60 2A D1 90 EC 39 C5 7D DA 62 93 -....`*...9...b. 0050: FB C9 F1 D6 16 54 48 FC BE 99 3E 03 0C 52 F2 6E .....TH...>..R.n 0060: EC D6 56 28 7B 92 D8 5A ..V(...Z V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapper.a :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key (from constructor)... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) => 3138888883 V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Trying to import the public key, object #0... V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.importKey :: [OkHttp https://<some_addr>/...] :: CryptImportKey(3138888883, [B@72e87d6, 0, 73728) => 3138898867 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138888883) for key: 3138898867 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138888883, 0), source = provider (after create/gen/derive/import/export) V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: The public key has been created. V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: exit V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: enter V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Public key is trusted = true V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Import public key: 0000: 30 66 30 1F 06 08 2A 85 03 07 01 01 01 01 30 13 0f0...*.......0. 0010: 06 07 2A 85 03 02 02 23 01 06 08 2A 85 03 07 01 ..*....#...*.... 0020: 01 02 02 03 43 00 04 40 E7 C9 49 7F AE 11 E3 25 ....C..@..I....% 0030: EB 49 5D 4B 1D C6 C0 48 4D A5 64 95 75 2A C0 75 .I]K...HM.d.u*.u 0040: 9B 46 96 4A 32 FF D3 65 E9 98 7D D4 F0 09 9F 21 .F.J2..e.......! 0050: A3 AF 0A CE 4C CC 71 CD D5 80 E2 E1 72 BB 61 67 ....L.q.....r.ag 0060: ED 1C 12 7C E8 E1 D5 4F .......O V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapper.a :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key (from constructor)... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) => 3138897859 V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Trying to import the public key, object #0... V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.importKey :: [OkHttp https://<some_addr>/...] :: CryptImportKey(3138897859, [B@1b73a57, 0, 73728) => 3138898291 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138897859) for key: 3138898291 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138897859, 0), source = provider (after create/gen/derive/import/export) V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: The public key has been created. V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: exit V/JCP: ru.CryptoPro.ssl.util.SecureChecker.checkPublicKeys :: Check completed. V/JCP: ru.CryptoPro.ssl.util.SecureChecker.checkPublicKeys :: sub exit V/JCP: ru.CryptoPro.ssl.cl_121.a :: Found trusted certificate: :: Certificate: Data: Version: 3 (0x2) Serial Number: 40:56:ed:00:99:a9:d6:af:49:c9:ff:98:b9:c7:0e:70 Signature Algorithm: 1.2.643.7.1.1.3.2 Issuer: 1.2.643.100.1=1037700085444/1.2.643.3.131.1.1=007717107991, C=RU, ST=Moscow, L=Moscow, O=LLC "Crypto-Pro", CN=CryptoPro GOST Root CA Validity Not Before: Nov 15 14:14:09 2018 GMT Not After : Nov 15 14:14:09 2033 GMT Subject: 1.2.643.100.1=1037700085444/1.2.643.3.131.1.1=007717107991, C=RU, ST=Moscow, L=Moscow, O=LLC "Crypto-Pro", CN=CryptoPro GOST Root CA Subject Public Key Info: Public Key Algorithm: 1.2.643.7.1.1.1.1 Unable to load Public Key 3943492104:error:06000080:public key routines:OPENSSL_internal:UNSUPPORTED_ALGORITHM:external/boringssl/src/crypto/evp/evp_asn1.c:110: 3943492104:error:0b00007d:X.509 certificate routines:OPENSSL_internal:PUBLIC_KEY_DECODE_ERROR:external/boringssl/src/crypto/x509/x_pubkey.c:158: X509v3 extensions: X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign X509v3 Subject Key Identifier: C2:36:4D:CC:24:26:0A:43:96:25:30:5B:67:57:9B:2A:C9:43:9C:D5 X509v3 Basic Constraints: critical CA:TRUE X509v3 Certificate Policies: Policy: 1.2.643.100.113.1 Policy: 1.2.643.100.113.2 Policy: 1.2.643.100.113.3 Policy: X509v3 Any Policy 1.2.643.100.112: 0...2........ ".................. HSM" ............ 2.0.3...... ".................. ...." (............ 2.0).O.................... ........................ ... ..../124-3475 .... 10.08.2018.4.................... ... 149/7/6/400 .... 17.10.2018 1.2.643.100.111: .2........ ".................. HSM" ............ 2.0 1.3.6.1.4.1.311.20.2: ..CA 1.3.6.1.4.1.311.21.1: ... 1.3.6.1.4.1.311.21.7: 0...*............. Signature Algorithm: 1.2.643.7.1.1.3.2 4a:d1:04:66:f2:7c:60:60:c6:00:06:a8:c3:87:86:25:75:be: e3:47:3d:74:a8:a2:0a:80:1d:c1:9e:31:e9:74:0f:c5:c5:7c: 2d:fa:c1:f2:bc:8a:cf:46:5c:07:9c:30:ee:65:09:62:ef:8f: 8a:1d:91:39:46:00:61:08:cf:23 V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: enter V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Public key is trusted = true V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: Import public key: 0000: 30 66 30 1F 06 08 2A 85 03 07 01 01 01 01 30 13 0f0...*.......0. 0010: 06 07 2A 85 03 02 02 24 00 06 08 2A 85 03 07 01 ..*....$...*.... 0020: 01 02 02 03 43 00 04 40 0E 8D DE BA 88 EF 08 AF ....C..@........ 0030: 6F 8D AB 35 9F 83 E3 BB BC AD D6 31 FF 91 E3 B6 o..5.......1.... 0040: 8C E4 07 D5 BD 10 7D 31 04 5F 32 69 CC CD A5 93 .......1._2i.... 0050: 8F 0C FA B6 5B 3B E0 09 56 04 71 4A F8 8A FA A9 ....[;..V.qJ.... 0060: 0F 68 BF 1C 54 1C 98 D1 .h..T... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.<init> :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapper.a :: sub enter V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Creating the public key (from constructor)... V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.acquireContext :: [OkHttp https://<some_addr>/...] :: CryptAcquireContext(null, Crypto-Pro GOST R 34.10-2012 KC1 CSP, 80, -268435456) => 3138900355 V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: Trying to import the public key, object #0... V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.importKey :: [OkHttp https://<some_addr>/...] :: CryptImportKey(3138900355, [B@5148944, 0, 73728) => 3138883507 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138900355) for key: 3138883507 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138900355, 0), source = provider (after create/gen/derive/import/export) V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.PublicKeySpecWrapperBase.a :: [OkHttp https://<some_addr>/...] :: The public key has been created. V/JCP: ru.CryptoPro.JCSP.Key.GostKeyFactory.engineGeneratePublic :: exit V/JCP: ru.CryptoPro.ssl.cl_64.a :: [read] MD5 and SHA1 hashes: len = :: 1304 ......... 0500: F5 D7 7B 2D 88 11 F9 E1 F3 2E D8 E5 DD 88 4B 76 ...-..........Kv 0510: EF 6A C1 39 C3 B8 7D B6 .j.9.... V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptHashData(3138856483, 3138800035, [B@a295a2d, 0, 1024) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptHashData(3138800323, 3138846259, [B@8e34b62, 0, 1024) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptHashData(3138843811, 3138844339, [B@98b24f3, 0, 1024) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptHashData(3138844867, 3138846115, [B@c72f5b0, 0, 1024) V/JCP: ru.CryptoPro.ssl.cl_64.a :: [Raw read]: length = :: 5 0000: 16 03 03 00 04 ..... V/JCP: ru.CryptoPro.ssl.cl_64.a :: [Raw read]: length = :: 4 0000: 0E 00 00 00 .... V/JCP: ru.CryptoPro.ssl.cl_64.b :: OkHttp https://<some_addr>/..., READ: TLSv1.2 Handshake, length = 4 V/JCP: ru.CryptoPro.ssl.cl_43.f :: *** ServerHelloDone V/JCP: ru.CryptoPro.ssl.cl_64.a :: [read] MD5 and SHA1 hashes: len = :: 4 0000: 0E 00 00 00 .... V/JCP: ru.CryptoPro.ssl.cl_16.a :: Generate pre-master-key. V/JCP: ru.CryptoPro.JCSP.Key.GostKeyGenerator.engineInit :: enter V/JCP: ru.CryptoPro.JCSP.Key.GostKeyGenerator.engineInit :: exit V/JCP: ru.CryptoPro.JCSP.Key.GostKeyGenerator.engineInit :: enter V/JCP: ru.CryptoPro.JCSP.Key.GostKeyGenerator.engineInit :: exit V/JCP: ru.CryptoPro.JCSP.Key.GostKeyGenerator.engineGenerateKey :: enter V/JCP: ru.CryptoPro.JCSP.Key.SecretKeyImpl.create :: enter V/JCP: ru.CryptoPro.JCSP.Key.SecretKeyImpl.createKey :: enter .................. V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.a :: [OkHttp https://<some_addr>/...] :: CryptSetKeyParam(3138881059, 3138909187, 104, [B@faea936, 0) V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.deriveKey :: MasterKeySpec:deriveKey() create secret key spec (mac) V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.deriveKey :: exit V/JCP: ru.CryptoPro.JCSP.Key.AbstractKeySpec.<init> :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_2.b :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.a :: [OkHttp https://<some_addr>/...] :: CryptGetKeyParam(3138881059, 3138909187, 104) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.a :: [OkHttp https://<some_addr>/...] :: CryptGetKeyParam(3138881059, 3138909187, 104) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_2.b :: sub exit V/JCP: ru.CryptoPro.JCSP.Key.AbstractKeySpec.<init> :: sub exit V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptDestroyHash(3138881059, 3138891907) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138881059, 0), source = hash V/JCP: ru.CryptoPro.ssl.cl_59.a :: CONNECTION KEYGEN: V/JCP: ru.CryptoPro.ssl.cl_59.a :: Client Nonce: 0000: 63 33 F7 82 64 FE 01 7B BA 9A 23 2A 93 05 B5 99 c3..d.....#*.... 0010: 71 A1 01 58 A8 15 0E 94 41 63 E3 65 4C A8 00 CE q..X....Ac.eL... V/JCP: ru.CryptoPro.ssl.cl_59.a :: Server Nonce: 0000: B3 A4 68 54 50 36 9F 61 BA 66 CB BC 51 04 E3 20 ..hTP6.a.f..Q.. 0010: A4 F8 45 77 13 60 3C D0 C5 B1 64 5B 25 DF A7 DE ..Ew.`<...d[%... V/JCP: ru.CryptoPro.ssl.cl_59.a :: Master Secret: :: ru.CryptoPro.JCSP.Key.MasterSecret@ab0b037 V/JCP: ru.CryptoPro.ssl.cl_59.a :: Client MAC write Secret: :: ru.CryptoPro.JCSP.Key.GostSecretKey@475f9a4 V/JCP: ru.CryptoPro.ssl.cl_59.a :: Server MAC write Secret: :: ru.CryptoPro.JCSP.Key.GostSecretKey@123730d V/JCP: ru.CryptoPro.ssl.cl_59.a :: Client write key: :: ru.CryptoPro.JCSP.Key.GostSecretKey@23422c2 V/JCP: ru.CryptoPro.ssl.cl_59.a :: Server write key: :: ru.CryptoPro.JCSP.Key.GostSecretKey@6d618d3 V/JCP: ru.CryptoPro.ssl.cl_59.a :: Client write IV: 0000: EB 1E EA 20 D4 A1 99 CD ... .... V/JCP: ru.CryptoPro.ssl.cl_59.a :: Server write IV: 0000: F1 B9 D6 A8 87 06 78 F2 ......x. V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.d :: [OkHttp https://<some_addr>/...] :: CryptDuplicateHash(3138856483, 3138800035) => 3138891907 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138856483) for hash: 3138891907 V/JCP: ru.CryptoPro.JCSP.Digest.BaseGostDigest.engineDigest :: enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptHashData(3138856483, 3138891907, [B@aeb0c10, 0, 884) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptGetHashParam(3138856483, 3138891907, 2, 32) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptDestroyHash(3138856483, 3138891907) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138856483, 0), source = hash V/JCP: ru.CryptoPro.JCSP.Digest.BaseGostDigest.engineDigest :: exit V/JCP: ru.CryptoPro.JCSP.Key.MasterSecret.computeFinished :: MasterSecret:computeFinished() hash master for finish hash V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.hashMasterForFinished :: enter V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.hashMasterForFinished :: MasterKeySpec:hashMasterForFinished() create finish prf hash V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.a :: [OkHttp https://<some_addr>/...] :: CryptCreateHash(3138881059, 32817, 3138876691, 0) => 3138891907 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138881059) for hash: 3138891907 V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.hashMasterForFinished :: MasterKeySpec:hashMasterForFinished() set tls prf label V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptSetHashParam(3138881059, 3138891907, 6, [B@e7eab20) V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.hashMasterForFinished :: MasterKeySpec:hashMasterForFinished() set tls prf seed V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptSetHashParam(3138881059, 3138891907, 7, [B@8213309) V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.hashMasterForFinished :: MasterKeySpec:hashMasterForFinished() get finish hash V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptGetHashParam(3138881059, 3138891907, 2, 12) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptDestroyHash(3138881059, 3138891907) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138881059, 0), source = hash V/JCP: ru.CryptoPro.JCSP.Key.MasterKeySpec.hashMasterForFinished :: exit V/JCP: ru.CryptoPro.ssl.cl_77.a :: OkHttp https://<some_addr>/..., WRITE: TLSv1.2 Change Cipher Spec, length = 1 V/JCP: ru.CryptoPro.ssl.cl_77.a :: [Raw write]: length = :: 6 0000: 14 03 03 00 01 01 ...... V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineInit :: sub enter ................ V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.engineInit :: sub exit V/JCP: ru.CryptoPro.ssl.cl_43.f :: *** Finished verify_data: { 63, 30, 6, 58, 171, 146, 235, 138, 100, 127, 143, 95 } *** V/JCP: ru.CryptoPro.ssl.cl_77.a :: [write] MD5 and SHA1 hashes: len = :: 16 0000: 14 00 00 0C 3F 1E 06 3A AB 92 EB 8A 64 7F 8F 5F ....?..:....d.._ V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.prepare :: sub enter .................. V/JCP: ru.CryptoPro.ssl.cl_77.a :: MAC computed: 1C 95 88 07 V/JCP: ru.CryptoPro.ssl.cl_8.a :: Begin encrypt... V/JCP: ru.CryptoPro.ssl.cl_8.a :: Plaintext before ENCRYPTION: len = :: 20 0000: 14 00 00 0C 3F 1E 06 3A AB 92 EB 8A 64 7F 8F 5F ....?..:....d.._ 0010: 1C 95 88 07 .... V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.engineUpdate :: sub enter ..................... V/JCP: ru.CryptoPro.ssl.cl_8.a :: Encrypted... V/JCP: ru.CryptoPro.ssl.cl_77.a :: [Raw write]: length = :: 25 0000: 16 03 03 00 14 39 DA A2 AA 72 0C 13 61 89 69 8B .....9...r..a.i. 0010: 63 63 9E 0B C8 99 46 3D DC cc....F=. V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.a :: OkHttp https://<some_addr>/..., received EOFException: error V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.a :: OkHttp https://<some_addr>/..., handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake V/JCP: ru.CryptoPro.ssl.SSLSessionImpl.invalidate :: %% Invalidated: :: [Session-2, TLS_CIPHER_2012] V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.a :: OkHttp https://<some_addr>/..., SEND TLSv1.2 ALERT: fatal, description = handshake_failure V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.d :: [OkHttp https://<some_addr>/...] :: CryptDuplicateHash(3138881059, 3138891907) => 3138880675 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138881059) for hash: 3138880675 V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineReset :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptDestroyHash(3138881059, 3138891907) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138881059, 0), source = hash V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineReset :: sub exit V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.d :: [OkHttp https://<some_addr>/...] :: CryptDuplicateHash(3138881059, 3138880675) => 3138891907 V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.contextAddRef :: [OkHttp https://<some_addr>/...] :: CryptContextAddRef(3138881059) for hash: 3138891907 V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineDoFinal :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptHashData(3138881059, 3138880675, [B@ebc4d28, 0, 44) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.c :: [OkHttp https://<some_addr>/...] :: CryptGetHashParam(3138881059, 3138880675, 2) size V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.c :: [OkHttp https://<some_addr>/...] :: CryptGetHashParam(3138881059, 3138880675, 2) data V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_3.a :: [OkHttp https://<some_addr>/...] :: CryptDestroyHash(3138881059, 3138880675) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138881059, 0), source = hash V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineDoFinal :: sub exit V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineReset :: sub enter V/JCP: ru.CryptoPro.JCSP.Cipher.GostMac.engineReset :: sub exit V/JCP: ru.CryptoPro.ssl.cl_77.a :: MAC computed: AF BF D8 42 V/JCP: ru.CryptoPro.ssl.cl_8.a :: Begin encrypt... V/JCP: ru.CryptoPro.ssl.cl_8.a :: Plaintext before ENCRYPTION: len = :: 6 0000: 02 28 AF BF D8 42 .(...B V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.engineUpdate :: sub enter V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.prepare :: sub enter V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.prepare :: sub exit V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.a :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.a :: [OkHttp https://<some_addr>/...] :: CryptEncrypt(3138881059, 3138794995, false, 0, [B@f97481a, [I@97dcf4b, 1032) V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.a :: sub exit V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.engineUpdate :: sub exit V/JCP: ru.CryptoPro.ssl.cl_8.a :: Encrypted... V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.a :: OkHttp https://<some_addr>/..., Exception sending alert: java.net.SocketException: Broken pipe V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.h :: OkHttp https://<some_addr>/... :: called closeSocket() V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.engineDoFinal :: sub enter V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.prepare :: sub enter V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.prepare :: sub exit V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.b :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.a :: [OkHttp https://<some_addr>/...] :: CryptEncrypt(3138881059, 3138794995, true, 0, [B@f97481a, [I@a9f3a41, 1032) V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.e :: sub enter V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_4.b :: [OkHttp https://<some_addr>/...] :: CryptDestroyKey(3138881059, 3138794995) V/JCP: ru.CryptoPro.JCSP.MSCAPI.cl_5.a :: [OkHttp https://<some_addr>/...] :: CryptReleaseContext(3138881059, 0), source = key V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.e :: sub exit V/JCP: ru.CryptoPro.JCSP.Cipher.GostCipher.engineDoFinal :: sub exit V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.close :: OkHttp https://<some_addr>/... :: called close() V/JCP: ru.CryptoPro.ssl.SSLSocketImpl.d :: OkHttp https://<some_addr>/..., called closeInternal(true)
Кто подскажет что делать?
|