Skip Menu |
 

This queue is for tickets about the Net-SSLeay CPAN distribution.

Report information
The Basics
Id: 59416
Status: resolved
Priority: 0/
Queue: Net-SSLeay

People
Owner: MIKEM [...] cpan.org
Requestors: maxime.therreault [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.36
Fixed in: (no value)



Subject: Problem with verify callback in multithreading context on Windows
When using a callback subroutine specified when calling method 'CTX_set_verify', the XS part of the module stores the association between the SSL context and the callback function in a HV Perl structure static variable called 'ssleay_ctx_verify_callbacks'. This variable is instantiated when the first callback is set. On Windows the "fork" being emulated using threads, it seems that the context of this Perl structure is not properly handled when used in another thread than the one in which it has been created. So when the callback is set in a main thread and called in a "forked" child, the callback subroutine simply does not receive parameters passed and the caller (the XS module) does not receive the returned value (being interpreted as a not valid certificate). On the other hand, if the callback is set in the "forked" child instead of the parent thread, the first one will work but trying to set the callback in another child will make an "Acces violation" an crash Perl. I'm using Perl ActiveState on a Windows 2003.
Download (untitled) / with headers
text/plain 1.1k
Can you confirm this issue is now fixed/ Cheers. On Thu Jul 15 11:53:05 2010, maxime.therreault wrote: Show quoted text
> When using a callback subroutine specified when calling method > 'CTX_set_verify', the XS part of the module stores the association > between the SSL context and the callback function in a HV Perl
structure Show quoted text
> static variable called 'ssleay_ctx_verify_callbacks'. This variable
is Show quoted text
> instantiated when the first callback is set. On Windows the "fork"
being Show quoted text
> emulated using threads, it seems that the context of this Perl
structure Show quoted text
> is not properly handled when used in another thread than the one in > which it has been created. > > So when the callback is set in a main thread and called in
a "forked" Show quoted text
> child, the callback subroutine simply does not receive parameters
passed Show quoted text
> and the caller (the XS module) does not receive the returned value > (being interpreted as a not valid certificate). On the other hand,
if Show quoted text
> the callback is set in the "forked" child instead of the parent
thread, Show quoted text
> the first one will work but trying to set the callback in another
child Show quoted text
> will make an "Acces violation" an crash Perl. > > I'm using Perl ActiveState on a Windows 2003.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.