The request was aborted: Could not create SSL/TLS secure channel


#1

Recently, I have been receiving the error “The request was aborted: Could not create SSL/TLS secure channel” when performing a C# WebRequest to the Forms API. The error happens randomly about 5% of the time. Nothing has changed in the code used to submit to the Forms API. The errors just started cropping up a few weeks ago. Below is the network trace log for one of the failed requests. A quick google search reveals that it’s possibly the remote server prematurely closing the connection.

System.Net Verbose: 0 : [6440] WebRequest::Create(https://forms.hubspot.com/uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717)
System.Net Verbose: 0 : [6440] HttpWebRequest#33736294::HttpWebRequest(https://forms.hubspot.com/uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717#375991902)
System.Net Verbose: 0 : [6440] Exiting HttpWebRequest#33736294::HttpWebRequest() 
System.Net Verbose: 0 : [6440] Exiting WebRequest::Create() 	-> HttpWebRequest#33736294
System.Net Verbose: 0 : [6440] HttpWebRequest#33736294::GetRequestStream()
System.Net Error: 0 : [6440] Can't retrieve proxy settings for Uri 'https://forms.hubspot.com/uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717'. Error code: 12180.
System.Net Information: 0 : [6440] Associating HttpWebRequest#33736294 with ServicePoint#35191196
System.Net Information: 0 : [6440] Associating Connection#48285313 with HttpWebRequest#33736294
System.Net.Sockets Verbose: 0 : [6440] Socket#31914638::Socket(InterNetwork#2)
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#31914638::Socket() 
System.Net.Sockets Verbose: 0 : [6440] Socket#18796293::Socket(InterNetworkV6#23)
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#18796293::Socket() 
System.Net.Sockets Verbose: 0 : [6440] Socket#31914638::Connect(21:443#358552019)
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#31914638::Connect() 
System.Net.Sockets Verbose: 0 : [6440] Socket#18796293::Close()
System.Net.Sockets Verbose: 0 : [6440] Socket#18796293::Dispose()
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#18796293::Close() 
System.Net Information: 0 : [6440] TlsStream#34948909::.ctor(host=forms.hubspot.com, #certs=0)
System.Net Information: 0 : [6440] Associating HttpWebRequest#33736294 with ConnectStream#46104728
System.Net Information: 0 : [6440] HttpWebRequest#33736294 - Request: POST /uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717 HTTP/1.1

System.Net Information: 0 : [6440] SecureChannel#12289376::.ctor(hostname=forms.hubspot.com, #clientCertificates=0)
System.Net Information: 0 : [6440] Enumerating security packages:
System.Net Information: 0 : [6440]     Negotiate
System.Net Information: 0 : [6440]     NegoExtender
System.Net Information: 0 : [6440]     Kerberos
System.Net Information: 0 : [6440]     NTLM
System.Net Information: 0 : [6440]     TSSSP
System.Net Information: 0 : [6440]     pku2u
System.Net Information: 0 : [6440]     WDigest
System.Net Information: 0 : [6440]     Schannel
System.Net Information: 0 : [6440]     Microsoft Unified Security Protocol Provider
System.Net Information: 0 : [6440]     CREDSSP
System.Net Information: 0 : [6440] SecureChannel#12289376 - Left with 0 client certificates to choose from.
System.Net Information: 0 : [6440] AcquireCredentialsHandle(package = Microsoft Unified Security Protocol Provider, intent  = Outbound, scc     = System.Net.SecureCredential)
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffer length=0, Out-Buffer length=121, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#31914638::Send()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#31914638::Send
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 74 01 00 00-70 03 01 5A 7C F1 85 6F : ....t...p..Z|..o
System.Net.Sockets Verbose: 0 : [6440] 00000010 : CA C0 60 4A 49 AE 2D 54-4C C1 AB 84 40 90 2E 26 : ..`JI.-TL...@..&
System.Net.Sockets Verbose: 0 : [6440] 00000020 : EF 16 C4 E0 BD 50 62 D7-60 12 60 00 00 14 00 2F : .....Pb.`.`..../
System.Net.Sockets Verbose: 0 : [6440] 00000030 : 00 35 00 0A C0 13 C0 14-C0 09 C0 0A 00 32 00 38 : .5...........2.8
System.Net.Sockets Verbose: 0 : [6440] 00000040 : 00 13 01 00 00 33 FF 01-00 01 00 00 00 00 16 00 : .....3..........
System.Net.Sockets Verbose: 0 : [6440] 00000050 : 14 00 00 11 66 6F 72 6D-73 2E 68 75 62 73 70 6F : ....forms.hubspo
System.Net.Sockets Verbose: 0 : [6440] 00000060 : 74 2E 63 6F 6D 00 0A 00-06 00 04 00 17 00 18 00 : t.com...........
System.Net.Sockets Verbose: 0 : [6440] 00000070 : 0B 00 02 01 00 00 23 00-00                      : ......#..
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#31914638::Send() 	-> 121#121
System.Net.Sockets Verbose: 0 : [6440] Socket#31914638::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#31914638::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 :                                                 : 
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#31914638::Receive() 	-> 0#0
System.Net.Sockets Verbose: 0 : [6440] Socket#31914638::Dispose()
System.Net Error: 0 : [6440] Exception in the HttpWebRequest#33736294:: - The underlying connection was closed: An unexpected error occurred on a send.
System.Net Information: 0 : [6440] Associating HttpWebRequest#33736294 with ServicePoint#35191196
System.Net Information: 0 : [6440] Associating Connection#43495525 with HttpWebRequest#33736294
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Socket(InterNetwork#2)
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Socket() 
System.Net.Sockets Verbose: 0 : [6440] Socket#33476626::Socket(InterNetworkV6#23)
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#33476626::Socket() 
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Connect(21:443#358552019)
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Connect() 
System.Net.Sockets Verbose: 0 : [6440] Socket#33476626::Close()
System.Net.Sockets Verbose: 0 : [6440] Socket#33476626::Dispose()
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#33476626::Close() 
System.Net Information: 0 : [6440] TlsStream#32854180::.ctor(host=forms.hubspot.com, #certs=0)
System.Net Information: 0 : [6440] Associating HttpWebRequest#33736294 with ConnectStream#27252167
System.Net Information: 0 : [6440] HttpWebRequest#33736294 - Request: POST /uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717 HTTP/1.1

System.Net Information: 0 : [6440] SecureChannel#43942917::.ctor(hostname=forms.hubspot.com, #clientCertificates=0)
System.Net Information: 0 : [6440] SecureChannel#43942917 - Left with 0 client certificates to choose from.
System.Net Information: 0 : [6440] Using the cached credential handle.
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = (null), targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffer length=0, Out-Buffer length=121, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Send()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Send
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 74 01 00 00-70 03 01 5A 7C F1 88 68 : ....t...p..Z|..h
System.Net.Sockets Verbose: 0 : [6440] 00000010 : 7F 3C AE A5 61 8E 54 F0-E0 E9 76 4E 37 73 9E 77 : .<..a.T...vN7s.w
System.Net.Sockets Verbose: 0 : [6440] 00000020 : 13 24 83 15 8E A4 74 04-BA 0A DB 00 00 14 00 2F : .$....t......../
System.Net.Sockets Verbose: 0 : [6440] 00000030 : 00 35 00 0A C0 13 C0 14-C0 09 C0 0A 00 32 00 38 : .5...........2.8
System.Net.Sockets Verbose: 0 : [6440] 00000040 : 00 13 01 00 00 33 FF 01-00 01 00 00 00 00 16 00 : .....3..........
System.Net.Sockets Verbose: 0 : [6440] 00000050 : 14 00 00 11 66 6F 72 6D-73 2E 68 75 62 73 70 6F : ....forms.hubspo
System.Net.Sockets Verbose: 0 : [6440] 00000060 : 74 2E 63 6F 6D 00 0A 00-06 00 04 00 17 00 18 00 : t.com...........
System.Net.Sockets Verbose: 0 : [6440] 00000070 : 0B 00 02 01 00 00 23 00-00                      : ......#..
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Send() 	-> 121#121
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 3F                                  : ....?
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 02 00 00 3B 03 01 5A 7C-F1 88 91 F1 6B A7 0C BE : ...;..Z|....k...
System.Net.Sockets Verbose: 0 : [6440] 00000015 : 66 B2 B7 C3 1B 10 AD 23-3F AD 5E A9 96 FB E4 08 : f......#?.^.....
System.Net.Sockets Verbose: 0 : [6440] 00000025 : F3 B6 B4 18 80 C8 00 C0-13 00 00 13 FF 01 00 01 : ................
System.Net.Sockets Verbose: 0 : [6440] 00000035 : 00 00 00 00 00 00 23 00-00 00 0B 00 02 01 00    : ......#........
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 63#63
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 09 CA                                  : .....
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] (printing 1024 out of 2506)
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 0B 00 09 C6 00 09 C3 00-05 4B 30 82 05 47 30 82 : .........K0..G0.
System.Net.Sockets Verbose: 0 : [6440] 00000015 : 04 2F A0 03 02 01 02 02-10 01 25 9F 85 52 74 E2 : ./........%..Rt.
System.Net.Sockets Verbose: 0 : [6440] 00000025 : 5F A4 68 D5 5F 45 CD 88-CD 30 0D 06 09 2A 86 48 : _.h._E...0...*.H
System.Net.Sockets Verbose: 0 : [6440] 00000035 : 86 F7 0D 01 01 0B 05 00-30 6F 31 0B 30 09 06 03 : ........0o1.0...
System.Net.Sockets Verbose: 0 : [6440] 00000045 : 55 04 06 13 02 55 53 31-0B 30 09 06 03 55 04 08 : U....US1.0...U..
System.Net.Sockets Verbose: 0 : [6440] 00000055 : 13 02 43 41 31 16 30 14-06 03 55 04 07 13 0D 53 : ..CA1.0...U....S
System.Net.Sockets Verbose: 0 : [6440] 00000065 : 61 6E 20 46 72 61 6E 63-69 73 63 6F 31 19 30 17 : an Francisco1.0.
System.Net.Sockets Verbose: 0 : [6440] 00000075 : 06 03 55 04 0A 13 10 43-6C 6F 75 64 46 6C 61 72 : ..U....CloudFlar
System.Net.Sockets Verbose: 0 : [6440] 00000085 : 65 2C 20 49 6E 63 2E 31-20 30 1E 06 03 55 04 03 : e, Inc.1 0...U..
System.Net.Sockets Verbose: 0 : [6440] 00000095 : 13 17 43 6C 6F 75 64 46-6C 61 72 65 20 49 6E 63 : ..CloudFlare Inc
System.Net.Sockets Verbose: 0 : [6440] 000000A5 : 20 52 53 41 20 43 41 2D-31 30 1E 17 0D 31 38 30 :  RSA CA-10...180
System.Net.Sockets Verbose: 0 : [6440] 000000B5 : 32 30 36 30 30 30 30 30-30 5A 17 0D 31 39 30 32 : 206000000Z..1902
System.Net.Sockets Verbose: 0 : [6440] 000000C5 : 30 36 31 32 30 30 30 30-5A 30 63 31 0B 30 09 06 : 06120000Z0c1.0..
System.Net.Sockets Verbose: 0 : [6440] 000000D5 : 03 55 04 06 13 02 55 53-31 0B 30 09 06 03 55 04 : .U....US1.0...U.
System.Net.Sockets Verbose: 0 : [6440] 000000E5 : 08 13 02 43 41 31 16 30-14 06 03 55 04 07 13 0D : ...CA1.0...U....
System.Net.Sockets Verbose: 0 : [6440] 000000F5 : 53 61 6E 20 46 72 61 6E-63 69 73 63 6F 31 19 30 : San Francisco1.0
System.Net.Sockets Verbose: 0 : [6440] 00000105 : 17 06 03 55 04 0A 13 10-43 6C 6F 75 64 46 6C 61 : ...U....CloudFla
System.Net.Sockets Verbose: 0 : [6440] 00000115 : 72 65 2C 20 49 6E 63 2E-31 14 30 12 06 03 55 04 : re, Inc.1.0...U.
System.Net.Sockets Verbose: 0 : [6440] 00000125 : 03 13 0B 68 75 62 73 70-6F 74 2E 63 6F 6D 30 82 : ...hubspot.com0.
System.Net.Sockets Verbose: 0 : [6440] 00000135 : 01 22 30 0D 06 09 2A 86-48 86 F7 0D 01 01 01 05 : ."0...*.H.......
System.Net.Sockets Verbose: 0 : [6440] 00000145 : 00 03 82 01 0F 00 30 82-01 0A 02 82 01 01 00 C7 : ......0.........
System.Net.Sockets Verbose: 0 : [6440] 00000155 : D4 B3 94 19 AF 61 E2 9F-52 DC 09 AA A2 55 73 EF : .....a..R....Us.
System.Net.Sockets Verbose: 0 : [6440] 00000165 : 28 B3 75 21 40 53 74 8D-32 BF F5 A1 02 74 41 0B : (.u!@St.2....tA.
System.Net.Sockets Verbose: 0 : [6440] 00000175 : 4A AB E5 B5 9C 67 29 4B-2B 5D 18 AF 56 B7 3C 7D : J....g)K+]..V.<}
System.Net.Sockets Verbose: 0 : [6440] 00000185 : 63 4C 5E DE 7E 71 1B A5-12 B0 38 80 C2 B1 D2 1F : cL^.~q....8.....
System.Net.Sockets Verbose: 0 : [6440] 00000195 : 75 4B 18 47 C6 83 13 14-DD 5A C4 AF FC 9F DC 74 : uK.G.....Z.....t
System.Net.Sockets Verbose: 0 : [6440] 000001A5 : 8E DB D6 F8 50 57 8C 12-E2 1D 51 13 A5 E5 F4 4B : ....PW....Q....K
System.Net.Sockets Verbose: 0 : [6440] 000001B5 : A1 73 7F A6 4C E9 B8 CA-D5 4C D5 E7 DC 70 DA 6A : .s..L....L...p.j
System.Net.Sockets Verbose: 0 : [6440] 000001C5 : 81 92 77 22 7C 1C 70 26-E1 17 60 27 6B 59 EB 72 : ..w"|.p&..`'kY.r
System.Net.Sockets Verbose: 0 : [6440] 000001D5 : 7E 18 31 DF 19 56 C3 EF-08 A6 85 8F F0 AC 60 06 : ~.1..V........`.
System.Net.Sockets Verbose: 0 : [6440] 000001E5 : D4 29 8A 90 26 69 A4 14-12 92 35 91 F8 22 1B F3 : .)..&i....5.."..
System.Net.Sockets Verbose: 0 : [6440] 000001F5 : 03 07 CA 6A C2 A5 D2 E5-30 AF 87 A0 FD 08 03 1E : ...j....0.......
System.Net.Sockets Verbose: 0 : [6440] 00000205 : 0C 6E FA E5 56 FB 7B 0E-F4 37 98 89 BD D2 5E 22 : .n..V.{..7....^"
System.Net.Sockets Verbose: 0 : [6440] 00000215 : D4 1E 4E 7B 78 8E 28 3D-D6 67 61 17 AE BF 52 94 : ..N{x.(=.ga...R.
System.Net.Sockets Verbose: 0 : [6440] 00000225 : 06 6F 4A AC 3A 76 35 BD-04 27 30 68 8A 8A D8 01 : .oJ.:v5..'0h....
System.Net.Sockets Verbose: 0 : [6440] 00000235 : 59 FA 65 DF 9F 2A 62 7A-42 73 9E 28 50 5B 0A 40 : Y.e..*bzBs.(P[.@
System.Net.Sockets Verbose: 0 : [6440] 00000245 : B9 D4 DB 8E B1 23 0A C9-C8 91 25 BD A7 D0 E9 02 : .....#....%.....
System.Net.Sockets Verbose: 0 : [6440] 00000255 : 03 01 00 01 A3 82 01 E9-30 82 01 E5 30 1F 06 03 : ........0...0...
System.Net.Sockets Verbose: 0 : [6440] 00000265 : 55 1D 23 04 18 30 16 80-14 91 05 8A DF 4C 22 C6 : U.#..0.......L".
System.Net.Sockets Verbose: 0 : [6440] 00000275 : 6D 8B 94 4C 16 45 7E EE-6F 02 FB B7 C0 30 1D 06 : m..L.E~.o....0..
System.Net.Sockets Verbose: 0 : [6440] 00000285 : 03 55 1D 0E 04 16 04 14-33 2F AB 7E AA 21 B7 89 : .U......3/.~.!..
System.Net.Sockets Verbose: 0 : [6440] 00000295 : F0 B2 19 CC E6 0F 0A CE-18 A1 FA 34 30 25 06 03 : ...........40%..
System.Net.Sockets Verbose: 0 : [6440] 000002A5 : 55 1D 11 04 1E 30 1C 82-0D 2A 2E 68 75 62 73 70 : U....0...*.hubsp
System.Net.Sockets Verbose: 0 : [6440] 000002B5 : 6F 74 2E 63 6F 6D 82 0B-68 75 62 73 70 6F 74 2E : ot.com..hubspot.
System.Net.Sockets Verbose: 0 : [6440] 000002C5 : 63 6F 6D 30 0E 06 03 55-1D 0F 01 01 FF 04 04 03 : com0...U........
System.Net.Sockets Verbose: 0 : [6440] 000002D5 : 02 05 A0 30 1D 06 03 55-1D 25 04 16 30 14 06 08 : ...0...U.%..0...
System.Net.Sockets Verbose: 0 : [6440] 000002E5 : 2B 06 01 05 05 07 03 01-06 08 2B 06 01 05 05 07 : +.........+.....
System.Net.Sockets Verbose: 0 : [6440] 000002F5 : 03 02 30 79 06 03 55 1D-1F 04 72 30 70 30 36 A0 : ..0y..U...r0p06.
System.Net.Sockets Verbose: 0 : [6440] 00000305 : 34 A0 32 86 30 68 74 74-70 3A 2F 2F 63 72 6C 33 : 4.2.0http://crl3
System.Net.Sockets Verbose: 0 : [6440] 00000315 : 2E 64 69 67 69 63 65 72-74 2E 63 6F 6D 2F 43 6C : .digicert.com/Cl
System.Net.Sockets Verbose: 0 : [6440] 00000325 : 6F 75 64 46 6C 61 72 65-49 6E 63 52 53 41 43 41 : oudFlareIncRSACA
System.Net.Sockets Verbose: 0 : [6440] 00000335 : 31 2E 63 72 6C 30 36 A0-34 A0 32 86 30 68 74 74 : 1.crl06.4.2.0htt
System.Net.Sockets Verbose: 0 : [6440] 00000345 : 70 3A 2F 2F 63 72 6C 34-2E 64 69 67 69 63 65 72 : p://crl4.digicer
System.Net.Sockets Verbose: 0 : [6440] 00000355 : 74 2E 63 6F 6D 2F 43 6C-6F 75 64 46 6C 61 72 65 : t.com/CloudFlare
System.Net.Sockets Verbose: 0 : [6440] 00000365 : 49 6E 63 52 53 41 43 41-31 2E 63 72 6C 30 4C 06 : IncRSACA1.crl0L.
System.Net.Sockets Verbose: 0 : [6440] 00000375 : 03 55 1D 20 04 45 30 43-30 37 06 09 60 86 48 01 : .U. .E0C07..`.H.
System.Net.Sockets Verbose: 0 : [6440] 00000385 : 86 FD 6C 01 01 30 2A 30-28 06 08 2B 06 01 05 05 : ..l..0*0(..+....
System.Net.Sockets Verbose: 0 : [6440] 00000395 : 07 02 01 16 1C 68 74 74-70 73 3A 2F 2F 77 77 77 : .....https://www
System.Net.Sockets Verbose: 0 : [6440] 000003A5 : 2E 64 69 67 69 63 65 72-74 2E 63 6F 6D 2F 43 50 : .digicert.com/CP
System.Net.Sockets Verbose: 0 : [6440] 000003B5 : 53 30 08 06 06 67 81 0C-01 02 02 30 76 06 08 2B : S0...g.....0v..+
System.Net.Sockets Verbose: 0 : [6440] 000003C5 : 06 01 05 05 07 01 01 04-6A 30 68 30 24 06 08 2B : ........j0h0$..+
System.Net.Sockets Verbose: 0 : [6440] 000003D5 : 06 01 05 05 07 30 01 86-18 68 74 74 70 3A 2F 2F : .....0...http://
System.Net.Sockets Verbose: 0 : [6440] 000003E5 : 6F 63 73 70 2E 64 69 67-69 63 65 72 74 2E 63 6F : ocsp.digicert.co
System.Net.Sockets Verbose: 0 : [6440] 000003F5 : 6D 30 40 06 08 2B 06 01-05 05 07 30 02 86 34 68 : m0@..+.....0..4h
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 2506#2506
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 01 4B                                  : ....K
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 0C 00 01 47 03 00 17 41-04 8B 9B 3B E5 9D 1F EF : ...G...A...;....
System.Net.Sockets Verbose: 0 : [6440] 00000015 : 68 BB 26 43 13 FC 84 E8-64 20 CE 4E D4 0A D5 94 : h.&C....d .N....
System.Net.Sockets Verbose: 0 : [6440] 00000025 : 95 02 D7 7C 67 48 8E B7-EB 43 D2 32 3C 84 1B 51 : ...|gH...C.2<..Q
System.Net.Sockets Verbose: 0 : [6440] 00000035 : 17 B5 44 46 BA CB 7B D3-12 D9 4E BF 68 0D D9 40 : ..DF..{...N.h..@
System.Net.Sockets Verbose: 0 : [6440] 00000045 : 53 EF FD 23 4C F2 BA 42-6F 01 00 AE 32 9E 8A EB : S..#L..Bo...2...
System.Net.Sockets Verbose: 0 : [6440] 00000055 : F9 FD B9 C3 4E D2 B6 59-50 98 FA 3E 61 06 FA 47 : ....N..YP..>a..G
System.Net.Sockets Verbose: 0 : [6440] 00000065 : D7 3C 04 2C 78 EA A5 E0-74 A0 69 C2 7C 08 2A B8 : .<.,x...t.i.|.*.
System.Net.Sockets Verbose: 0 : [6440] 00000075 : 00 D6 3F 6E 35 F5 D1 3A-30 77 D8 A6 78 33 A5 8C : ..?n5..:0w..x3..
System.Net.Sockets Verbose: 0 : [6440] 00000085 : F9 C4 D3 A4 01 FD BF 95-93 26 7B 91 FD E4 3C 28 : .........&{...<(
System.Net.Sockets Verbose: 0 : [6440] 00000095 : 6C CA A8 E1 F2 13 7F 25-5B BB B2 9D FC DF FB FB : l......%[.......
System.Net.Sockets Verbose: 0 : [6440] 000000A5 : 97 96 E9 5D 30 02 61 12-26 62 25 A5 02 CB 32 A4 : ...]0.a.&b%...2.
System.Net.Sockets Verbose: 0 : [6440] 000000B5 : 95 77 A8 30 2B BC 68 4F-94 43 8B CA CA 19 40 B3 : .w.0+.hO.C....@.
System.Net.Sockets Verbose: 0 : [6440] 000000C5 : AA 68 65 7D 21 E1 42 F0-0F 6C CC 6E 3E 67 23 8D : .he}!.B..l.n>g#.
System.Net.Sockets Verbose: 0 : [6440] 000000D5 : 21 BC D8 DD 34 C1 6C 52-73 3A 03 3A 67 C1 85 71 : !...4.lRs:.:g..q
System.Net.Sockets Verbose: 0 : [6440] 000000E5 : 5B 48 2C 67 7D 0F C1 78-A0 74 89 BB C6 74 84 B2 : [H,g}..x.t...t..
System.Net.Sockets Verbose: 0 : [6440] 000000F5 : 06 0E 01 39 42 24 62 8A-65 A4 BB 48 22 F5 CD 12 : ...9B$b.e..H"...
System.Net.Sockets Verbose: 0 : [6440] 00000105 : A7 56 84 41 BB 5C D9 90-A5 CC C4 9E 3B 08 FC 42 : .V.A.\......;..B
System.Net.Sockets Verbose: 0 : [6440] 00000115 : F5 68 AD FE 3A 36 F4 B5-D7 FC E0 FB 51 0A C1 87 : .h..:6......Q...
System.Net.Sockets Verbose: 0 : [6440] 00000125 : F0 17 DC 71 A1 23 C7 A8-47 FC BB 90 42 13 B3 74 : ...q.#..G...B..t
System.Net.Sockets Verbose: 0 : [6440] 00000135 : 7D D2 1D E8 B6 4E 7E EE-76 41 BA C9 AB 10 16 7E : }....N~.vA.....~
System.Net.Sockets Verbose: 0 : [6440] 00000145 : 15 52 F2 7C 88 13 8E 99-F2 60 10                : .R.|.....`.
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 331#331
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 04                                  : .....
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 0E 00 00 00                                     : ....
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 4#4
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=134, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Send()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Send
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 46 10 00 00-42 41 04 87 19 E7 6B 44 : ....F...BA....kD
System.Net.Sockets Verbose: 0 : [6440] 00000010 : D2 73 F4 B0 98 3C 26 F4-15 E2 86 3F DA 25 84 F0 : .s...<&....?.%..
System.Net.Sockets Verbose: 0 : [6440] 00000020 : 11 A0 18 70 37 51 56 8E-DB 72 EF E3 8C 09 35 C0 : ...p7QV..r....5.
System.Net.Sockets Verbose: 0 : [6440] 00000030 : 94 EF 2A EE BE 2E 95 03-72 9E 0F 3B 88 A6 8D 24 : ..*.....r..;...$
System.Net.Sockets Verbose: 0 : [6440] 00000040 : 89 CC 38 5D F1 76 03 DC-26 CF 32 14 03 01 00 01 : ..8].v..&.2.....
System.Net.Sockets Verbose: 0 : [6440] 00000050 : 01 16 03 01 00 30 04 63-55 0A 03 E5 07 94 64 EF : .....0.cU.....d.
System.Net.Sockets Verbose: 0 : [6440] 00000060 : C0 B3 7D BC B5 B7 D0 A0-AC EB F2 BF 6F 78 0C 95 : ..}.........ox..
System.Net.Sockets Verbose: 0 : [6440] 00000070 : 48 D4 D2 A5 DF 1F BC 40-D1 C7 03 2A 20 74 54 17 : H......@...* tT.
System.Net.Sockets Verbose: 0 : [6440] 00000080 : 6F F9 13 36 DD F1                               : o..6..
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Send() 	-> 134#134
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 BA                                  : .....
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 04 00 00 B6 00 00 FD 1F-00 B0 84 9B 4B B4 8A 89 : ............K...
System.Net.Sockets Verbose: 0 : [6440] 00000015 : 13 EB EF A7 71 86 62 B8-85 ED 2E 89 40 DF 61 83 : ....q.b.....@.a.
System.Net.Sockets Verbose: 0 : [6440] 00000025 : 1B BF B6 18 36 86 E9 46-02 8A CC 66 C2 4C 8B A3 : ....6..F...f.L..
System.Net.Sockets Verbose: 0 : [6440] 00000035 : 70 04 8C E0 49 4C 56 C5-D2 F2 48 9D 89 3A 53 C8 : p...ILV...H..:S.
System.Net.Sockets Verbose: 0 : [6440] 00000045 : B2 17 E7 35 8B E1 0D D2-F9 3F 13 23 1E FB D2 43 : ...5.....?.#...C
System.Net.Sockets Verbose: 0 : [6440] 00000055 : E5 06 44 D0 EE 08 92 FA-9B C2 BA 59 93 24 54 D5 : ..D........Y.$T.
System.Net.Sockets Verbose: 0 : [6440] 00000065 : 47 FF 7B E3 99 21 FB 77-E6 2E AA 00 D9 5C FD 39 : G.{..!.w.....\.9
System.Net.Sockets Verbose: 0 : [6440] 00000075 : 94 24 9A 15 C7 B1 87 60-B3 2E 75 08 67 70 62 09 : .$.....`..u.gpb.
System.Net.Sockets Verbose: 0 : [6440] 00000085 : 7D 28 82 0D B5 B1 5B 94-6E D6 F4 91 E2 B2 14 20 : }(....[.n...... 
System.Net.Sockets Verbose: 0 : [6440] 00000095 : 04 C0 28 74 89 9A 09 57-5B FA 77 7D 16 1D A1 88 : ..(t...W[.w}....
System.Net.Sockets Verbose: 0 : [6440] 000000A5 : 65 61 6B 90 11 63 D5 AF-D8 F0 BE BA D1 97 21 CD : eak..c........!.
System.Net.Sockets Verbose: 0 : [6440] 000000B5 : BF C5 79 38 43 A1 2A 9E-B6 AF                   : ..y8C.*...
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 186#186
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 14 03 01 00 01                                  : .....
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 01                                              : .
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 1#1
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=ContinueNeeded).
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 16 03 01 00 30                                  : ....0
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : 74 9E E4 6E 14 69 D4 5E-E7 06 BB 6C 86 23 8E A8 : t..n.i.^...l.#..
System.Net.Sockets Verbose: 0 : [6440] 00000015 : 51 F2 9C 65 E2 DA 52 CC-08 DA 56 C9 4A 2C A3 3A : Q..e..R...V.J,.:
System.Net.Sockets Verbose: 0 : [6440] 00000025 : 32 8E 43 7E 2F FB E9 73-86 4A 65 4D 24 B4 54 7C : 2.C~/..s.JeM$.T|
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 48#48
System.Net Information: 0 : [6440] InitializeSecurityContext(credential = System.Net.SafeFreeCredential_SECURITY, context = f0c780:98b5efad70, targetName = forms.hubspot.com, inFlags = ReplayDetect, SequenceDetect, Confidentiality, AllocateMemory, InitManualCredValidation)
System.Net Information: 0 : [6440] InitializeSecurityContext(In-Buffers count=2, Out-Buffer length=0, returned code=OK).
System.Net Information: 0 : [6440] Remote certificate: [Version]
  V3

[Subject]
  CN=hubspot.com, O="CloudFlare, Inc.", L=San Francisco, S=CA, C=US
  Simple Name: hubspot.com
  DNS Name: hubspot.com

[Issuer]
  CN=CloudFlare Inc RSA CA-1, O="CloudFlare, Inc.", L=San Francisco, S=CA, C=US
  Simple Name: CloudFlare Inc RSA CA-1
  DNS Name: CloudFlare Inc RSA CA-1

[Serial Number]
  01259F855274E25FA468D55F45CD88CD

[Not Before]
  2/5/2018 6:00:00 PM

[Not After]
  2/6/2019 6:00:00 AM

[Thumbprint]
  D7BCC0F33936572F85C246C87D100E89FFC1544A

[Signature Algorithm]
  sha256RSA(1.2.840.113549.1.1.11)

[Public Key]
  Algorithm: RSA
  Length: 2048
  Key Blob: 30 82 01 0a 02 82 01 01 00 c7 d4 b3 94 19 af 61 e2 9f 52 dc 09 aa a2 55 73 ef 28 b3 75 21 40 53 74 8d 32 bf f5 a1 02 74 41 0b 4a ab e5 b5 9c 67 29 4b 2b 5d 18 af 56 b7 3c 7d 63 4c 5e de 7e 71 1b a5 12 b0 38 80 c2 b1 d2 1f 75 4b 18 47 c6 83 13 14 dd 5a c4 af fc 9f dc 74 8e db d6 f8 50 57 8c 12 e2 1d 51 13 a5 e5 f4 4b a1 73 7f a6 4c e9 b8 ca d5 4c d5 e7 dc 70 da 6a 81 92 77 22 7c 1c ....
System.Net Information: 0 : [6440] SecureChannel#43942917 - Remote certificate was verified as valid by the user.

The request was aborted: Could not create SSL/TLS secure channel.
#2

Continued Error Message from above.

System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Send()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Send
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 17 03 01 00 F0 36 56 DD-57 BA 06 14 57 9B A8 15 : .....6V.W...W...
System.Net.Sockets Verbose: 0 : [6440] 00000010 : C6 6C A3 6A 4B 8B 46 9A-CD D7 44 4D 25 A9 AA 8E : .l.jK.F...DM%...
System.Net.Sockets Verbose: 0 : [6440] 00000020 : 08 34 E0 D7 14 A1 92 7E-E6 07 9C C3 34 69 2D 55 : .4.....~....4i-U
System.Net.Sockets Verbose: 0 : [6440] 00000030 : 17 C1 7C 43 6C 1C 5E 09-A9 0A 6E 11 F6 EB 02 8A : ..|Cl.^...n.....
System.Net.Sockets Verbose: 0 : [6440] 00000040 : F1 2C FD 76 3B 55 DC FB-3F 77 C5 65 59 DA 8F 01 : .,.v;U..?w.eY...
System.Net.Sockets Verbose: 0 : [6440] 00000050 : 75 34 1B 54 AD 3B AD C0-4E C9 FD 4E 79 11 E7 DC : u4.T.;..N..Ny...
System.Net.Sockets Verbose: 0 : [6440] 00000060 : A4 82 6D 5A 3E 3B 6B 8B-AF 4E 3E ED 0E 1E 15 E8 : ..mZ>;k..N>.....
System.Net.Sockets Verbose: 0 : [6440] 00000070 : D9 38 DA 20 BC 8F 67 08-39 5C 6B 3B EE 0B A7 9F : .8. ..g.9\k;....
System.Net.Sockets Verbose: 0 : [6440] 00000080 : B3 59 CF 74 DE 3B 85 E7-FA 9B 78 EC 37 48 05 BB : .Y.t.;....x.7H..
System.Net.Sockets Verbose: 0 : [6440] 00000090 : B3 3F D0 7E A6 7B B1 42-BD E8 2F D0 D7 D8 C6 53 : .?.~.{.B../....S
System.Net.Sockets Verbose: 0 : [6440] 000000A0 : 56 44 08 FF A7 37 BC 1F-0C A8 D4 E5 2A 62 ED 47 : VD...7......*b.G
System.Net.Sockets Verbose: 0 : [6440] 000000B0 : D7 4B 00 69 0B 2E BF 69-46 68 6C 3D 4D A0 CF 05 : .K.i...iFhl=M...
System.Net.Sockets Verbose: 0 : [6440] 000000C0 : 20 A2 36 33 0B 5E 73 9C-F8 F1 B4 BD DC 11 5F 8A :  .63.^s......._.
System.Net.Sockets Verbose: 0 : [6440] 000000D0 : FE C2 18 74 55 6E AE E1-C0 C5 42 D5 89 57 8D DE : ...tUn....B..W..
System.Net.Sockets Verbose: 0 : [6440] 000000E0 : 2C 04 FB BF 52 B0 AB 85-3D B3 53 83 C0 04 D6 4D : ,...R...=.S....M
System.Net.Sockets Verbose: 0 : [6440] 000000F0 : ED 13 84 E1 AA                                  : .....
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Send() 	-> 245#245
System.Net Information: 0 : [6440] ConnectStream#27252167 - Sending headers
{
Content-Type: application/x-www-form-urlencoded
Host: forms.hubspot.com
Content-Length: 234
Expect: 100-continue
Connection: Close
}.
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000000 : 15 03 01 00 20                                  : .... 
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 5#5
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Receive()
System.Net.Sockets Verbose: 0 : [6440] Data from Socket#55915408::Receive
System.Net.Sockets Verbose: 0 : [6440] 00000005 : B9 6F 62 AA 0A 4D 6E 2E-B8 64 93 C7 38 18 D6 10 : .ob..Mn..d..8...
System.Net.Sockets Verbose: 0 : [6440] 00000015 : 21 21 66 30 03 8B 5B F4-D6 11 1A 81 08 E4 19 30 : !!f0..[........0
System.Net.Sockets Verbose: 0 : [6440] Exiting Socket#55915408::Receive() 	-> 32#32
System.Net Error: 0 : [6440] Decrypt failed with error 0X90317.
System.Net.Sockets Verbose: 0 : [6440] Socket#55915408::Dispose()
System.Net Error: 0 : [6440] Exception in the HttpWebRequest#33736294:: - The underlying connection was closed: The connection was closed unexpectedly.
System.Net Error: 0 : [6440] Exception in the HttpWebRequest#33736294::EndGetRequestStream - The underlying connection was closed: The connection was closed unexpectedly.

#3

Hi @andrew.wilinski,

This looks to me like it might be caused by some general network issues between your server and the HubSpot API. Do you see any similar issues with other services? Other possible explanations:

  • It’s possible that we’re timing out the request if there’s a significant delay between when you open the connection and when you send along the data.
  • We might be closing the connection if you’re setting the Transfer-Encoding: header to chunked

#4

I have no issues with any other services. I use Google’s Recaptcha service right before the hubspot forms API call. The Recaptcha service never errors out.

The timeout for the connection is set to 100 seconds. I would have to believe that would be ample time to complete the request. I am not setting any Transfer-Encoding header in the request.

About 95% of the time, the forms api submission is successful. The other 5% fail with this error. There has been no code of server configuration changes on my side. This started happening about 4 weeks ago. Prior to that there was no issues. To me it feels like there’s a server in the hubspot forms api server pool that’s not behaving properly and I seem to be hitting that server about 5% of the time.


#5

Hi @andrew.wilinski,

Thanks for your patience here. The forms API servers are part of a pool, but all servers are up-to-date with identical configurations. When you say that you’re setting the connection timeout to 100 seconds, are you referring to a request timeout (e.g. you wait for a server response for 100s) or how long you’re keeping a connection alive (e.g. you open a connection that is used for multiple requests for 100s). Also, are you connecting to the HubSpot API and then making a request to Google’s Recaptcha service before making the request to HubSpot?

Here’s where my head is at:

  • This could be a timeout on our end:
    • If the time between your server opening a connection and actually sending the data is too long, we might be timing out the request.
    • If you’re keeping a connection open for a fixed 100 seconds (even without request traffic) we might be timing out the connection. It’s possible your server might then attempt to re-use that connection and fail.
  • This could be a connection management issue:
    • If you’re setting a 100 second lifespan for a connection being used by your server to make multiple requests, rather than letting the server defaults manage the connection lifespan, there could be requests being made right before the 100s connection limit, resulting in lost requests.

Does any of that sound like it might be happening to you? I’m not familiar with your systems, so I’m making a few assumptions and trying to identify possible causes. Can you give me some more info regarding your setup?


#6

Hi Derek. Thank you for replying. I really appreciate it

I’m using C# to create a WebRequest object. I am creating a new object for each call, so I don’t think there’s an issue with the connection being held open. I’m not exactly sure how .NET does that behind the scenes, so I can’t be 100% positive. Below is the code I’m using to post to the Forms API.

    static void Main(string[] args) {
        try {
            if(File.Exists("network.log"))
                File.Delete("network.log");
            Console.WriteLine("Submitting....");
            var hsContext = new Dictionary<string, string>() {
                {"hutk", null},
                {"ipAddress", "208.87.237.201"},
                {"pageUrl", "/contact-us"}
            };
            var data = new Dictionary<string, string>() {
                {"firstname", "Andrew"},
                {"lastname", "Wilinski"},
                {"email", "Andrew.Wilinski@bossplow.com"},
                {"phone", String.Empty},
                {"preferredContactMethod", "Email"},
                {"message", "Test"}
            };
            StringBuilder postData = new StringBuilder();
            foreach(var pair in data)
                postData.AppendFormat("{0}={1}&", pair.Key, HttpUtility.UrlEncode(pair.Value));
            postData.AppendFormat("hs_context={0}", HttpUtility.UrlEncode(new JavaScriptSerializer().Serialize(hsContext)));
            string postUrl = "https://forms.hubspot.com/uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(postUrl);
            request.Method = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postData.Length;
            request.KeepAlive = false;
            using(StreamWriter writer = new StreamWriter(request.GetRequestStream())) {
                writer.Write(postData.ToString());
            }
            using(HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
                Console.WriteLine("Response Status: {0}", response.StatusCode);
            }
        }
        catch(Exception ex) {
            Console.WriteLine("Error: {0}", ex.Message);
            File.Copy("network.log", "network_error.log");
        }
        Console.WriteLine("Done.");
        //Console.ReadLine();
    }

As for Recaptcha, I’m calling the validation API before calling the hubspot API, so I know the form submission from our website is valid. I am using the same WebRequest (new object, not reusing an existing one) method to interact with the Recaptcha API. That process succeeds 100% of the time.

Andrew Wilinski | Supervisor, IS | BOSS Products | (906) 776-3621


#7

Hi @andrew.wilinski,

That all appears fine to me, thanks for the example. At this point, I'm going to have to dig a bit deeper into some of our logs to see if I can find any clues. Can you send me the following details for the most recent failure you have:

  • The ip address your request is coming from
  • The timestamp of the error
  • The full url you made the request to
    • presumably this one? https://forms.hubspot.com/uploads/form/v2/111368/40055487-5d1a-4de0-a85d-87d8104cc717

With that info, I'll dig around in our system and CDN logs to see if I can find any more info on what might be going on. Thanks again for your patience here, I look forward to getting this all sorted.


#8

Hi Derek,

Here’s the information you requested.

Andrew Wilinski | Supervisor, IS | BOSS Products | (906) 776-3621


#9

Hi @andrew.wilinski,

I believe we've resolved the issue on our end. It looks like it was a heightened security setting on our end that resulted in some requests being erroneously filtered out. That should be resolved as of right now; can you continue to monitor your requests and let me know if you continue to see these failures?


#10

Awesome. Thank you very much Derek. I have not received any failures today, so I think we’re good. I would usually get about a dozen or so a day.

Andrew Wilinski | Supervisor, IS | BOSS Products | (906) 776-3621


#11

Hi @andrew.wilinski,

Brilliant! That's great news. I'll consider this resolved for now, but going forward feel free to bump this thread if these failures end up recurring in the future.