https://bugs.winehq.org/show_bug.cgi?id=36635
--- Comment #2 from Bruno Jesus 00cpxxx@gmail.com --- In secur32/schannel.c:
892 /* Perform the TLS handshake */ 893 ret = schan_imp_handshake(ctx->session);
The ctx->session will only be initialized if (!phContext):
795 if (!phContext) 796 { ... 821 if (!schan_imp_create_session(&ctx->session, cred)) 822 { 823 schan_free_handle(handle, SCHAN_HANDLE_CTX); 824 HeapFree(GetProcessHeap(), 0, ctx); 825 return SEC_E_INTERNAL_ERROR; 826 }
So it's indeed using an invalid ctx->session at line 893. I don't know if ctx->session was supposed to be already created or if it should be set to NULL or created in the else branch of the (!phContext) if.