2016-07-14 175 views
1

我一直在掙扎一段時間,一個項目包括從服務器調用方法與Https連接。 我得到一個404代碼,但地址存在,所以這是證書的問題。HTTPS客戶端java與p12證書

到目前爲止,我有這樣的代碼:

System.setProperty("javax.net.ssl.keyStoreType", "pkcs12"); 
    System.setProperty("javax.net.ssl.trustStoreType", "jks"); 
    System.setProperty("javax.net.ssl.keyStore", "./cert/walkiriaapps_dev_cert.p12"); 
    System.setProperty("javax.net.ssl.trustStore", "./cert/gridserver.keystore"); 
    System.setProperty("javax.net.debug", "ssl"); 
    System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword); 
    System.setProperty("javax.net.ssl.keyStorePassword", keyStorePassword); 

    try { 
     SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); 
     URL url = new URL(SERVER_URL); 
     HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); 
     conn.setSSLSocketFactory(sslsocketfactory); 

     System.out.println(conn.getResponseCode()); 
     InputStream inputstream = conn.getInputStream(); 
     InputStreamReader inputstreamreader = new InputStreamReader(inputstream); 
     BufferedReader bufferedreader = new BufferedReader(inputstreamreader); 

     String string = null; 
     while ((string = bufferedreader.readLine()) != null) { 
      System.out.println("Received " + string); 
     } 
    } catch (MalformedURLException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (IOException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 

由於調試啓用時,我得到了以下信息:

keyStore is : ./cert/walkiriaapps_dev_cert.p12 keyStore type is : pkcs12 keyStore provider is : init keystore init keymanager of type SunX509 
*** found key for : [hidden by me ;)] chain [0] = [ [ Version: V3 Subject: [hidden by me ;)] Signature Algorithm: SHA1withRSA, OID 
=xxxxxx 

    Key: Sun RSA public key, 2048 bits modulus: 25618728526980407715404586197565746577652430166924543443958281662634742897052603095095758511147901575124400320179797331860716646860486870953395736561894316707521150349144946687953313723171397095268376530520667100869163032007829998448800202165918944214576419025925092328986301138158279604039024071057779082107833750510476901348232496212394760754318237941183777058043657818962756546399885751494495606397844915051787505208471929043203878929121386289922849774283250681494624102067989726841385828897870956338426474470018535626512167695988102150213586310503588030098931234831662882919587388701417158847960514277726029356783 public exponent: 65537 Validity: [From: Sat Jul 02 12:29:45 CEST 2016, 
       To: Sun Jul 02 12:29:45 CEST 2017] Issuer: [hidden by me ;)] SerialNumber: [ 02] 

Certificate Extensions: 4 [1]: ObjectId: 2.5.29.35 Criticality=false AuthorityKeyIdentifier [ KeyIdentifier [ 0000: 41 73 44 CA 83 7C 81 B0 86 7B B4 0D E9 13 BD 71 AsD............q 0010: 38 77 01 2C   8w., ] ] 

[2]: ObjectId: 2.5.29.19 Criticality=true BasicConstraints:[ CA:false PathLen: undefined ] 

[3]: ObjectId: 2.5.29.37 Criticality=false ExtendedKeyUsages [ clientAuth serverAuth ] 

[4]: ObjectId: 2.5.29.15 Criticality=true KeyUsage [ DigitalSignature Key_Encipherment Data_Encipherment Key_Agreement ] 

] Algorithm: [SHA1withRSA] Signature: 0000: 19 49 F6 4E CD 69 10 5E 3D 97 2C 09 4C 57 2B 65 .I.N.i.^=.,.LW+e 0010: FD 32 3E B3 80 B0 9B D6 9C 67 27 F2 BC B4 97 A7 .2>......g'..... 0020: D7 BC 71 B6 3A B6 39 02 94 34 97 32 2E 74 A2 35 ..q.:.9..4.2.t.5 0030: 30 C5 2A 99 4F D0 1B 64 B1 3B 0A 69 18 68 A8 73 0.*.O..d.;.i.h.s 0040: 5A 26 3B 61 A6 18 C7 A3 D7 85 8C 7D 5B 07 08 69 Z&;a........[..i 0050: 6A 32 AC 2B 7A F8 E6 42 07 84 BA A6 E4 F1 AD B6 j2.+z..B........ 0060: E5 FB 78 55 97 27 80 ED 49 49 54 E8 D0 E2 96 09 ..xU.'..IIT..... 0070: 1B 75 D7 4A 53 C5 70 8B CF 76 60 65 9D 1D 39 0E .u.JS.p..v`e..9. 0080: 32 39 88 7C C4 7B 48 3D C3 FF 73 C5 7E 65 B1 08 
29....H=..s..e.. 0090: 1B 56 60 B2 45 87 09 50 14 7C 30 20 CD EC 33 78 .V`.E..P..0 ..3x 00A0: B9 46 47 36 E8 58 AA 03 DA DC F6 0D C7 0B E5 24 .FG6.X.........$ 00B0: 36 4A F2 D6 32 93 CF A6 83 E0 82 70 85 29 A7 34 6J..2......p.).4 00C0: 03 9F 16 93 C3 15 43 6E FE 8C 20 26 38 0F B2 F4 ......Cn.. &8... 00D0: C8 AC 5F 0F 2D 40 2A 2E EC 47 49 F6 AD D3 67 03 [email protected]*..GI...g. 00E0: E6 DF BA DC 47 38 E1 68 92 1D 52 C8 A0 A7 CE 91 ....G8.h..R..... 00F0: C1 FF 21 59 F1 E9 F6 7B 2D 80 00 02 C7 52 43 08 ..!Y....-....RC. 

] 
*** trustStore is: ./cert/gridserver.keystore trustStore type is : jks trustStore provider is : init truststore adding as trusted cert: Subject: [hidden by me ;)] Issuer: C[hidden by me ;)] Algorithm: RSA; Serial number: 0x2 Valid from Sun Jun 05 18:14:09 CEST 2016 until Sat Jun 05 18:14:09 CEST 2021 

trigger seeding of SecureRandom done seeding SecureRandom Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 Allow unsafe renegotiation: false Allow legacy hello messages: true Is initial handshake: true Is secure renegotiation: false main, setSoTimeout(0) called %% No cached client session 
*** ClientHello, TLSv1 RandomCookie: GMT: 1451660641 bytes = { 57, 105, 46, 174, 145, 121, 25, 154, 153, 98, 42, 167, 8, 12, 239, 100, 189, 241, 227, 213, 2, 113, 124, 68, 83, 172, 29, 43 } Session ID: {} Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] Compression Methods: { 0 } Extension elliptic_curves, curve names: {secp256r1, secp384r1, secp521r1} Extension ec_point_formats, formats: [uncompressed] Extension server_name, server_name: [host_name: demo.iquvo.com] 
*** main, WRITE: TLSv1 Handshake, length = 130 main, READ: TLSv1 Handshake, length = 89 
*** ServerHello, TLSv1 RandomCookie: GMT: -1444518719 bytes = { 36, 208, 126, 45, 135, 54, 250, 142, 92, 198, 36, 156, 192, 11, 103, 194, 152, 198, 167, 103, 143, 118, 208, 42, 70, 245, 183, 60 } Session ID: {23, 159, 75, 230, 109, 209, 13, 253, 76, 213, 99, 240, 87, 145, 195, 170, 169, 39, 162, 123, 163, 19, 46, 187, 67, 117, 144, 64, 92, 177, 195, 191} Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA Compression Method: 0 Extension renegotiation_info, renegotiated_connection: <empty> Extension ec_point_formats, formats: [uncompressed, ansiX962_compressed_prime, ansiX962_compressed_char2] 
*** %% Initialized: [Session-1, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA] 
** TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA main, READ: TLSv1 Handshake, length = 982 
*** Certificate chain chain [0] = [ [ Version: V3 Subject: CN=demo.iquvo.com, OU=iquvo Systems, O=iquvo, L=Madrid, ST=Madrid, C=ES Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5 

    Key: Sun RSA public key, 2048 bits modulus: 23453645515854966924301205454696625328671479972464738543799836932127583641533813201400570740442560086912845820094275679055549988049658631777847332739248681132642932519165249875037014213452555762465878771543919238414780931857222019527866816147448967113080291383819384893029975957613712051652474661438461078816940552511636651932730286186599058948852155547351329972057697689307521243133360393947364340527532395277333228473022288074415918366159232974257664555640802067520693478750525144409451882709715874673237455724895036797475043632724593718904286605604489464163002898051877745616161768837246505670061362321331950680997 public exponent: 65537 Validity: [From: Tue Jul 12 23:42:19 CEST 2016, 
       To: Sat Jun 05 18:14:09 CEST 2021] Issuer: [hidden by me ;)] SerialNumber: [ 03] 

Certificate Extensions: 4 [1]: ObjectId: 2.5.29.35 Criticality=false AuthorityKeyIdentifier [ KeyIdentifier [ 0000: 41 73 44 CA 83 7C 81 B0 86 7B B4 0D E9 13 BD 71 AsD............q 0010: 38 77 01 2C   8w., ] ] 

[2]: ObjectId: 2.5.29.19 Criticality=true BasicConstraints:[ CA:false PathLen: undefined ] 

[3]: ObjectId: 2.5.29.37 Criticality=false ExtendedKeyUsages [ emailProtection clientAuth serverAuth ] 

[4]: ObjectId: 2.5.29.15 Criticality=true KeyUsage [ DigitalSignature Key_Encipherment Data_Encipherment Key_Agreement ] 

] Algorithm: [SHA1withRSA] Signature: 0000: 45 64 14 E0 A0 20 C0 86 EC 28 23 69 B1 93 D7 15 Ed... ...(#i.... 0010: A1 5C 19 80 20 8A BF E8 00 AF A6 C1 D5 98 4B BA .\.. .........K. 0020: EC BC F4 20 3E 04 AE 2A AD D6 9D E8 CD 5E 22 DB ... >..*.....^". 0030: 54 38 87 AC 3E C9 AE DC F9 F4 EA AF 90 68 53 8A T8..>........hS. 0040: 95 E9 18 4E 71 60 A8 55 C8 93 D7 EF 05 2C A9 0F ...Nq`.U.....,.. 0050: AA 54 D0 27 A4 8F 57 58 63 0E 02 5E 6D ED A1 8F .T.'..WXc..^m... 0060: EC B9 6E 58 49 D1 B2 FF F9 A4 19 06 83 B9 3B 12 ..nXI.........;. 0070: DA 62 2D B1 9B EC FB 52 DC 1A 5B 32 4A 14 3F EC .b-....R..[2J.?. 0080: 2D 5F 1C 86 90 29 D9 89 A7 B0 76 DA 2C 17 98 A1 
-_...)....v.,... 0090: 81 C7 22 E8 AD 52 1A 88 D3 19 24 D9 E0 63 56 04 .."..R....$..cV. 00A0: 5A C7 AC 00 7F 90 84 0F 44 F9 3C 5F 45 C8 2B F2 Z.......D.<_E.+. 00B0: 55 7F C6 EE B8 82 4F B0 E6 42 9D 66 1C CD D3 C0 U.....O..B.f.... 00C0: 00 36 31 EB 65 6B 94 BC 82 4D 07 53 21 B9 A3 66 .61.ek...M.S!..f 00D0: 5A C9 40 A8 2D B0 BB 73 84 94 9F 5B D7 81 F2 E3 [email protected][.... 00E0: 15 9B D3 F6 A1 8E 02 1B E6 61 2A 78 27 28 8F 9C .........a*x'(.. 00F0: 3F 3D 78 A9 3A 27 A3 6D 92 20 4D B2 21 0F FE 98 ?=x.:'.m. M.!... 

] 
*** Found trusted certificate: [ [ Version: V3 Subject: [hidden by me ;)] Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5 

    Key: Sun RSA public key, 2048 bits modulus: 21150877640234016381111274098046984118683206683014739756833065339354409251839034422389305077192144292296518982097404972859365369550733381248230874970257083954569244169241161038537457114078913978977609733079736696758855067361535741860901054811684551240975716527800277810041882930012408864592120187014516031281102491071972501707919016868527591234611111398168176959894432634785347671362404715931317393588706237672365619642155446754496385612099649836213550463477173184091172816433791766397039664840301452611626359011252247894238973019470395261962737635899132289408179107156743574679199231017113344711234513933791463056697 public exponent: 65537 Validity: [From: Sun Jun 05 18:14:09 CEST 2016, 
       To: Sat Jun 05 18:14:09 CEST 2021] Issuer: CN=iquvo Root CA, OU=IT, O=iquvo, L=Madrid, ST=Madrid, C=ES SerialNumber: [ 02] 

Certificate Extensions: 5 [1]: ObjectId: 2.5.29.35 Criticality=false AuthorityKeyIdentifier [ KeyIdentifier [ 0000: 2F 23 F4 86 C9 49 F1 6B 6D 7A 04 16 EE C9 51 E3 /#...I.kmz....Q. 0010: 62 AE C1 F0   b... ] ] 

[2]: ObjectId: 2.5.29.19 Criticality=true BasicConstraints:[ CA:true PathLen:2147483647 ] 

[3]: ObjectId: 2.5.29.37 Criticality=false ExtendedKeyUsages [ clientAuth serverAuth ] 

[4]: ObjectId: 2.5.29.15 Criticality=true KeyUsage [ Key_Encipherment Data_Encipherment Key_Agreement Key_CertSign ] 

[5]: ObjectId: 2.5.29.14 Criticality=false SubjectKeyIdentifier [ KeyIdentifier [ 0000: 41 73 44 CA 83 7C 81 B0 86 7B B4 0D E9 13 BD 71 AsD............q 0010: 38 77 01 2C         8w., ] ] 

] Algorithm: [SHA1withRSA] Signature: 0000: 56 16 97 C3 4A 99 48 EB B8 B9 DC 8D 86 3C 35 88 V...J.H......<5. 0010: 7A 41 29 D5 3E 60 C6 2C A0 94 31 CB 80 AD 30 25 zA).>`.,..1...0% 0020: DE 31 62 16 FC EF 84 94 64 CD F7 68 59 11 D8 EA .1b.....d..hY... 0030: 39 0A C1 E3 86 CF B1 EC B0 1F 3C 31 FD 27 CA B3 9.........<1.'.. 0040: 52 E9 AF 69 BC F0 D7 E3 E1 43 CB 5A 1B 66 1B 39 R..i.....C.Z.f.9 0050: 06 79 40 53 40 FF FA 6E A6 76 A0 31 4D 4B DA 6F [email protected]@..n.v.1MK.o 0060: 72 02 E6 F0 37 B5 33 98 60 C8 7B 38 EA FE BC 5F r...7.3.`..8..._ 0070: D1 47 7F 9D 16 7B 02 3E 47 C6 15 1A 98 9F 80 EE .G.....>G....... 0080: A7 36 96 37 0D 21 F8 89 99 F7 31 EF 2A 6F AA AC .6.7.!....1.*o.. 0090: 1F 5D F4 B2 8C 78 A8 16 15 E7 D7 66 DF 0A 82 14 .]...x.....f.... 00A0: 09 71 20 7F 82 56 76 69 FC 12 6E B6 8F B2 73 94 .q ..Vvi..n...s. 00B0: C4 D8 FD E5 D5 58 A8 30 3B C4 E9 5B F3 91 10 AA .....X.0;..[.... 00C0: E6 A1 49 23 51 0F 52 6F 93 C0 B4 9B C1 BB C8 D5 ..I#Q.Ro........ 00D0: 50 C7 19 78 F5 07 F0 9F 87 C6 E1 B2 65 03 ED 93 P..x........e... 00E0: EF D3 D9 F4 EB 02 1D 2D E5 BB BB B1 84 43 37 E2 .......-.....C7. 00F0: DC 00 BD 54 5B 61 25 A1 AB 44 F5 54 DC 1D 52 53 ...T[a%..D.T..RS 0100: 16 D0 34 2F BD BE B4 4C A7 8C 1C 2A CB F1 90 C1 ..4/...L...*.... 0110: AD 42 2D CF 8A 43 2E B6 4D 4C 2A B0 2D 0F 5B 5F .B-..C..ML*.-.[_ 0120: 97 D0 E8 3C 1D C1 2D 90 4E 0F C6 DA 96 9C 9B DF ...<..-.N....... 0130: 92 FA 82 82 51 78 14 99 B9 D3 7B 6B FC 72 B6 EE ....Qx.....k.r.. 0140: C1 B4 55 73 68 43 4B F3 0A 6B 96 78 31 3B FC C7 ..UshCK..k.x1;.. 0150: 5D CC 7B 96 F8 AC 84 6C FA CA 91 9D DA B9 43 44 ]......l......CD 0160: 2F 81 78 1F 66 41 B8 6C 67 16 78 1C CF 1D 63 75 /.x.fA.lg.x...cu 0170: DC 7E 4E 15 DB A9 C0 5D 16 C3 55 A8 B2 B8 7A C3 ..N....]..U...z. 0180: 4A C5 B4 11 33 6F 50 56 8A 94 35 22 7E 7D 92 4D J...3oPV..5"...M 0190: 2D F9 F8 06 12 41 35 D3 64 9D AA 43 BA C7 22 F5 
-....A5.d..C..". 01A0: 05 EB 32 0E 90 FD B2 0A E8 EC 6B 06 1A 08 84 87 ..2.......k..... 01B0: 57 6D 40 07 5F 21 B6 E6 0D FC D4 A2 95 FD 0A 36 [email protected]_!.........6 01C0: 30 37 76 44 F3 5F 91 75 78 CB 9C 17 6B EE 7F 22 07vD._.ux...k.." 01D0: D2 C5 35 62 13 1E 19 EC FE 17 2E 44 3D 5C 4E 3D ..5b.......D=\N= 01E0: 22 6D 49 FC 67 83 F4 64 0E 25 F8 B1 D4 01 94 86 "mI.g..d.%...... 01F0: 9D CC 59 60 6E 1D E2 6D 8C 0D 4A 2E C8 FC 96 65 ..Y`n..m..J....e 0200: 54 D2 B4 81 A7 46 FC FD 76 62 DF 35 FF 57 6D 52 T....F..vb.5.WmR 0210: 80 5A B8 55 CB 9F 30 9C F7 9A AB F3 F6 03 2C 24 .Z.U..0.......,$ 0220: F3 C4 EB 69 D0 5E BC 88 23 79 B6 AF B4 3E 99 D6 ...i.^..#y...>.. 0230: 23 A0 9E 38 EB 6E 07 DC 73 68 29 B0 BF 31 9C 5B #..8.n..sh)..1.[ 0240: 98 6A C5 35 D4 BD C3 C9 84 76 57 4E 8D FE D8 B1 .j.5.....vWN.... 0250: 61 CC 6C 21 0D 81 AF FC 9C 25 C9 3B 63 89 AA BA a.l!.....%.;c... 0260: D2 B4 EE 55 F1 91 D0 11 9C 6C B1 19 D8 F1 AF 5A ...U.....l.....Z 0270: 61 B0 50 A4 2E 67 3A 70 7B 21 02 5B 01 97 F6 13 a.P..g:p.!.[.... 

] main, READ: TLSv1 Handshake, length = 331 
*** ECDH ServerKeyExchange Server key: SunPKCS11-NSS EC public key, 256 bits (id 1, session object) public x coord: 108716438294959703938428424752528805236505078799371900849087416902745394709600 public y coord: 57795240448396850305572109632694865628751011045103794660332140731467128933682 parameters: secp256r1 [NIST P-256, X9.62 prime256v1] (1.2.840.10045.3.1.7) main, READ: TLSv1 Handshake, length = 4 
*** ServerHelloDone 
*** ECDHClientKeyExchange ECDH Public value: { 4, 0, 7, 233, 95, 210, 116, 207, 113, 216, 119, 101, 210, 13, 4, 36, 106, 106, 135, 250, 172, 165, 233, 23, 130, 142, 31, 62, 236, 215, 18, 31, 93, 5, 70, 11, 193, 130, 163, 152, 108, 208, 250, 103, 139, 13, 176, 206, 126, 164, 7, 239, 85, 47, 156, 118, 240, 99, 179, 128, 103, 164, 96, 137, 85 } main, WRITE: TLSv1 Handshake, length = 70 SESSION KEYGEN: PreMaster Secret: 0000: 5F BA 2A 35 33 D4 12 7C F1 D6 3D 50 64 75 F4 72 
_.*53.....=Pdu.r 0010: 69 ED F1 56 1E 7E 1D 87 48 EF E9 A3 1B 91 56 31 i..V....H.....V1 CONNECTION KEYGEN: Client Nonce: 0000: 57 87 95 61 39 69 2E AE 91 79 19 9A 99 62 2A A7 W..a9i...y...b*. 0010: 08 0C EF 64 BD F1 E3 D5 02 71 7C 44 53 AC 1D 2B ...d.....q.DS..+ Server Nonce: 0000: AA E6 65 C1 24 D0 7E 2D 87 36 FA 8E 5C C6 24 9C ..e.$..-.6..\.$. 0010: C0 0B 67 C2 98 C6 A7 67 8F 76 D0 2A 46 F5 B7 3C ..g....g.v.*F..< Master Secret: 0000: 41 8A E8 BC 20 58 1D AE 3A 3F 12 52 29 CF 6F 12 A... X..:?.R).o. 0010: EA 0B 6B 4E C1 25 18 26 0E 1C C3 F3 A8 76 FD 39 ..kN.%.&.....v.9 0020: 44 52 B4 A0 74 A8 B6 E9 5F 76 1D C4 34 6D 95 E2 DR..t..._v..4m.. Client MAC write Secret: 0000: DF 20 3D 63 00 EE 2B EA 5D 59 94 01 34 C8 3A 90 . 
=c..+.]Y..4.:. 0010: B8 3C 2B 2F          .<+/ Server MAC write Secret: 0000: 2B 0E 4B AA EC FD 54 EB 40 6C C1 0F 13 54 FD 47 [email protected] 0010: A1 53 A6 02      .S.. Client write key: 0000: 26 60 BE EC AB 06 75 E2 02 B4 39 61 35 62 0C 84 &`....u...9a5b.. 0010: 16 CB 80 19 93 79 80 01 B6 6B E9 0C F5 4F BA DB .....y...k...O.. Server write key: 0000: B6 2C DA 3D 00 44 2A 80 6F 65 47 36 EB A8 D7 40 .,.=.D*[email protected] 0010: 0C CC CD 89 08 A1 7B 85 B4 7B 4E 6D EE 10 5F 9A ..........Nm.._. Client write IV: 0000: 8B CB FE C2 FA 56 A3 C9 7E E5 FA E9 C8 76 F3 40 [email protected] Server write IV: 0000: 5A C8 CC E7 91 D9 31 77 1B 10 A3 57 5B D1 CC 9C Z.....1w...W[... main, WRITE: TLSv1 Change Cipher Spec, length = 1 
*** Finished verify_data: { 184, 20, 223, 36, 23, 103, 162, 66, 34, 130, 130, 172 } 
*** main, WRITE: TLSv1 Handshake, length = 48 main, READ: TLSv1 Change Cipher Spec, length = 1 main, READ: TLSv1 Handshake, length = 48 
*** Finished verify_data: { 11, 150, 72, 24, 35, 222, 227, 77, 59, 153, 109, 157 } 
*** %% Cached client session: [Session-1, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA] main, WRITE: TLSv1 Application Data, length = 192 main, READ: TLSv1 Application Data, length = 368 

我感謝所有幫助,讓我指出了正確的方向。

謝謝。

回答

0

問題在於URL是錯誤的。

我在這裏留下問題,如果有人需要此示例代碼。

謝謝。