"Christian Biesinger" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Kate X wrote:
>> Would anybody give me a hint of how to add my custom badCertHandler, or 
>> anyother solution for this problem?
>
> You can either register a global badCertHandler by implementing 
> nsIBadCertListener with a contract ID of 
> "@mozilla.org/nsBadCertListener;1".
>
> Or, in Gecko 1.8 and later, you can do this on a per-channel basis by 
> implementing nsIInterfaceRequestor, giving out some object in response to 
> nsIBadCertListener, and setting that interface requestor as the channel's 
> notification callbacks.

Thanks for reply.

I tried to implement nsIInterfaceRequestor in my uriChannel listener, and 
set the channel's notification callbacks with it. But when bad cert found 
and NSS is trying to get the handler from callbacks, that callback is not 
the callback I set from channel. so it failed. And also HttpChannel has 
getSecurityInfo method which is supposed to give the securityInfo of the 
connection, but it is only get assigned when status is ok, I've checked the 
OnStatus event of nsIProgressEventSink, I can see the securityInfo get set 
while httpTransaction on going, because the securityInfo is newed as 
NSSSocketInfo, it is valid in httpConnection and httpTransaction, but not in 
httpChannel. How could I get it, even if I can get this, I don't think I can 
change it while the connection is alive.
any hint?

Thanks,

Kate. 


_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to