login about faq

The demonstration code at https://www.example-code.com/cpp/socket_async.asp crashes with an access violation if the server does not support TLS. I believe this happens while (connectTask->get_Finished() != true){} is still spinning. It should return a catchable error instead. I used https://github.com/PavelBansky/EchoTool on localhost with echotool /p tcp /s 443 as the command line argument for my server (but presumably the effect will exist with other servers.

If the server is not launched, the while loop exits cleanly. If I set useTls to false, the while loop exits cleanly.

I've pasted the call stack on crash below. I'm using Visual Studio 2013 and a basic console application.

ConsoleApplication1.exe!TlsProtocol::clientHandshake2(bool,class TlsEndpoint &,class _clsTls &,unsigned int,class SocketParams &,class LogBase &)   C++
ConsoleApplication1.exe!TlsProtocol::clientHandshake(bool,class chilkat::StringBuffer const &,class TlsEndpoint &,class _clsTls &,unsigned int,class SocketParams &,class LogBase &)    C++
ConsoleApplication1.exe!SChannelChilkat::connectImplicitSsl(class chilkat::StringBuffer const &,int,class _clsTls &,unsigned int,class SocketParams &,class LogBase &)  C++
ConsoleApplication1.exe!Socket2::connect2(class chilkat::StringBuffer const &,int,bool,class _clsTls &,class SocketParams &,class LogBase &)    C++
ConsoleApplication1.exe!Socket2::socket2Connect(class chilkat::StringBuffer const &,int,bool,class _clsTls &,unsigned int,class SocketParams &,class LogBase &) C++
ConsoleApplication1.exe!ClsSocket::clsSocketConnect(class XString &,int,bool,int,class SocketParams &,class LogBase &)  C++
ConsoleApplication1.exe!ClsSocket::Connect(class XString &,int,bool,int,class ProgressEvent *)  C++
ConsoleApplication1.exe!fn_socket_connect(class ClsBase *,class ClsTask *)  C++
ConsoleApplication1.exe!ClsTask::callTaskFunction(class LogBase *)  C++
ConsoleApplication1.exe!_ckThread::runThread(void)  C++
ConsoleApplication1.exe!_ckThreadPool::finalizeThreadPool(void) C++
kernel32.dll!777f7c04() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]  
[External Code]

asked Feb 02 at 15:57

mgrivich's gravatar image


edited Feb 02 at 16:00

What version of Chilkat are you using?


answered Feb 02 at 16:48

chilkat's gravatar image

chilkat ♦♦


(Feb 02 at 16:56) mgrivich

That's doesn't quite answer the question. Is it v9.5.0.65, 64, 63.... ?

(Feb 02 at 17:10) chilkat ♦♦ It took me a bit to find because of the lack of a readme file in the download at https://www.chilkatsoft.com/downloads_vcpp.asp. I had to run get_Version().

(Feb 02 at 17:57) mgrivich

I found and fixed the problem. I'll reply with a pre-release build of v9.5.0.66 once it's ready...


answered Feb 02 at 20:00

chilkat's gravatar image

chilkat ♦♦

Thanks. Please see "answer" below for another issue. I'm not sure if your site sends you a notification on other answers.

(Feb 06 at 16:02) mgrivich

Thanks. The crashing is fixed. On to the next issue (or I can make a new forum question if you prefer). We have a server that supports SSL 3.0, but not SSL 2.0. Using socket.put_SslProtocol( "SSL 3.0" ); works, and using socket.put_SslProtocol( "SSL 2.0" ); fails, as it should. However, socket.put_SslProtocol( "default" ); fails, but it should not. I expect it to detect and use SSL 3.0. Note that default did work with SSL 3.0 as of chilkat version 9.3.2, which I am upgrading from.

Note that your example server (chilkatsoft.com:443) supports SSL 2.0 but not SSL 3.0 and using default works. It may be that default always uses SSL 2.0 rather than detecting the server. If true, this would contradict the documentation at https://www.chilkatsoft.com/refdoc/vcCkSocketRef.html, put_SslProtocol.


answered Feb 03 at 15:10

mgrivich's gravatar image


I think it would be appropriate to start a new question for this.

(Feb 06 at 18:28) jpbro ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Feb 02 at 15:57

Seen: 531 times

Last updated: Feb 07 at 13:07

powered by OSQA