Closed Bug 268264 Opened 20 years ago Closed 20 years ago

nsISSLSocketControl interface not scriptable

Categories

(Core :: Networking, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: pete, Assigned: darin.moz)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.5 (KHTML, like Gecko) Safari/125.11
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

I am developing an extension for firefox that I'd like to have the ability to add ssl to an already open 
socket (via starttls).  The nsISSLSocketControl provides such an interface, but it is not scriptable.  I've 
changed the 'noscript' keywords in the nsISSLSocketControl.idl and nsISSLSocketProvider.idl to 
'scriptable', and my application works, negotiating the tls just fine, even prompting me for the usual 
self-signed certificate warnings.

I was wondering if it's possible to get this small change put into firefox before the 1.0 release.  I'm not 
sure that this is the correct channel to ask on, so please let me know if I should ask somewhere else.

Here's the diffs for what I changed to make it work for me:

[petesmactop:netwerk/socket/base] pete% cvs diff
cvs diff: Diffing .
Index: nsISSLSocketControl.idl
===============================================================
====
RCS file: /cvsroot/mozilla/netwerk/socket/base/nsISSLSocketControl.idl,v
retrieving revision 1.5
diff -r1.5 nsISSLSocketControl.idl
29c29
< [noscript, uuid(8b3e8488-1dd2-11b2-b547-956290be347c)]
---
> [scriptable, uuid(8b3e8488-1dd2-11b2-b547-956290be347c)]
Index: nsISSLSocketProvider.idl
===============================================================
====
RCS file: /cvsroot/mozilla/netwerk/socket/base/nsISSLSocketProvider.idl,v
retrieving revision 1.4
diff -r1.4 nsISSLSocketProvider.idl
27c27
< [noscript, uuid(856a93d0-5415-11d3-bbc8-0000861d1237)]
---
> [scriptable, uuid(856a93d0-5415-11d3-bbc8-0000861d1237)]


Thanks,

-Pete


Reproducible: Always
Steps to Reproduce:
this._transport = this._sockService.createTransport(["starttls"], 1, host, port, null);
var si = this._transport.securityInfo;
si.QueryInterface(Components.interfaces.nsISSLSocketControl);
si.StartTLS();

Actual Results:  
An exception happened at the QueryInterface call, because Components.interfaces.nsISSLSocketControl 
was null.

Expected Results:  
Add the nsISSLSocketControl interface.
we didn't need to do this, although we did end up adding an interface that
converts a socket into an ssl socket.

in the future, please file bugs based on the components where the code lives
(this is mozilla/networking, not mozilla/browser, so it's a browser:networking
bug), and please attach your diffs (cvs diff -up8 or so) using the create a new
attachment link after filing your bug, instead of inlining them. thanks
Assignee: bugs → darin
Component: Extension/Theme Manager → Networking
Product: Firefox → Browser
QA Contact: bugs → benc
Version: unspecified → Trunk
hmm, is nsISSLSocketProvider needed at all? it has no methods or attributes.
yeah, i don't think there's any point to keeping nsISSLSocketProvider around.  i
doubt anyone will hold firefox 1.0 for this.  if you really want it, send mail
to aviary@mozilla.org

meanwhile, i'll attach a patch.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → mozilla1.8beta
Attached patch v1 patchSplinter Review
Attachment #165056 - Flags: review?(cbiesinger)
Comment on attachment 165056 [details] [diff] [review]
v1 patch

looks good. while touching this, might it be a good idea to remove the
forceHandshake attribute, which has a no-op impl and the comments say is
unused?

r=biesi either way.
Attachment #165056 - Flags: review?(cbiesinger) → review+
biesi: sure, for the trunk... i'd do that plus document the interface :)

this patch is for consideration on the aviary 1.0 branch, so i wanted to keep it
bare bones simple.
Flags: blocking-aviary1.0?
Attachment #165056 - Flags: approval1.7.x?
Attachment #165056 - Flags: approval-aviary?
Flags: blocking1.7.x?
timeless, 

I appreciate the helpful suggestions in your comment.  I'm not sure I understand the first sentence, 
though.  Are you saying that we don't need this patch for 1.0 because there is another interface I can 
use in javascript to convert the socket into an ssl socket?

And thanks, Darin, for the patch.
We're done here. Sorry - workaround is (unfortunately) to impl in C++. 
Flags: blocking-aviary1.0? → blocking-aviary1.0-
Attachment #165056 - Flags: approval-aviary?
ok, no point in trying to land this on the 1.7 branch then.  removing
blocking1.7.x request.

fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Flags: blocking1.7.x?
Resolution: --- → FIXED
Attachment #165056 - Flags: approval1.7.x?
I filed bug 268335 for tracking future cleanup of nsISSLSocketControl.
filed bug 288011 on elimiating nsISSLSocketProvider (comment 2)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: