Core Graveyard
Security: UI
16 years ago
2 years ago


(Reporter: kaie, Assigned: kaie)


1.0 Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [adt1 rtm] [ETA 06/20], URL)


(1 attachment, 1 obsolete attachment)



16 years ago
Fix PSM's proxy logic


16 years ago


16 years ago
Blocks: 88381

Comment 1

16 years ago
The following are comments from bugscape 12934, where connecting to a secure
site over proxy did not work, but delayed very long and finally showed error -12263.

nelsonb said:

"If you contact an SSL2 only server with a client that does not send
ssl2-compatible client hello messages, you get precisely this behavior.
Note that disabling SSL2 does not (er, should not) disable the sending
of ssl2-compatible client hello messages for SSL3 and TLS.

So, I'd guess that your browser had disabled SSL2-compatibile client
hellos.  That's a bad thing to do for https servers.  https servers
should, IMO, always have ssl2-compatible client hellos enabled. 

Only certain protocols (i.e. other than https) that are known to never
use ssl2 should ever disable ssl2-compatible client hellos.

This seems like a PSM bug.


Apparently, this user's browser was attempting to visit an https server
(http over SSL) and the SSL socket was configured to disable SSL v2 
compatible client hellos.  IMO, that should never happen; that is, 
all SSL sockets used by http (as opposed to those used by, say IMAP)
should always have SSL v2 compatible client hellos enabled.  Whatever
code is disabling SSL v2 compatible client hellos is in error (IMO)
in the context of https.  

I'd guess that some code has confused the meanings and purposes of the 
I'd guess that the user had disabled SSL2 (using the GUI), and as a 
result, the code had disabled SSL_V2_COMPATIBLE_HELLO, perhaps because
the programmer thought (incorrectly) that this is necessary to disable 
the SSL v2 protocol.  

Of course, if SSL v2 is disabled, the user is not going to succesfully 
be able to read email from an ssl-v2-only https server such as, but at least the user will not experience a hung 
connection, as this user did.  Instead, the user should get back a message
saying something like "The browser and this server cannot communicate
securely because they have no SSL ciphers in common".  That's what 
C4.7x says when you visit this site with SSL2 disabled.


BTW, PSM has a class called a "TLSSocket" which IMO is sadly misnamed.  
This socket type exists to be used in protocols that do "Start-TLS"
(and hence should be called StartTLSSocket).  Start-TLS is a means for
starting TLS (and/or SSL3) on a TCP connection that is already in use
without SSL/TLS.  In order to do Start-TLS, it _IS_ necessary to 
disable SSL_V2_COMPATIBLE_HELLO.  AFAIK, this is the ONLY occasion on
which it is appropriate to disable SSL_V2_COMPATIBLE_HELLO, and it 
should only be done for protocols that do the Start-TLS, such as IMAP.  
https NEVER uses Start-TLS, and https sockets should never use 
"StartTLSSocket" sockets.  

Note that the Start-TLS protocol is sometimes erroneously described 
in the PSM code with the words "SSL Step UP" or "TLS Step UP".  That is 
unfortunate.  "Step Up" is a feature of the SSL and TLS protocols and
has NOTHING to do with Start-TLS, so it is unfortunate that these terms
are confused in PSM.


One more important clarification.  
Going through a proxy is NOT the same as using Start-TLS! 

A proxy (e.g. socks or http) does an initial handshake with the client,
and thereafter passes all data through without interpretation.  This
is true of SOCKS proxies, and of any proxy that implements the CONNECT

For such proxies, the decision of whether or not to use SSL_V2_COMPATIBLE_HELLO
is purely a function of the protocol being spoken by the final server.  If you 
disable SSL_V2_COMPATIBLE_HELLO when not using a proxy, then you would also 
disable it when using a proxy.  If you enable SSL_V2_COMPATIBLE_HELLO when not 
using a proxy, then you would also enable it when using a proxy.  So, https 
always should use SSL_V2_COMPATIBLE_HELLO, whether using a proxy or not.   
If IMAPS doen't SSL_V2_COMPATIBLE_HELLO when not using a proxy, then it also 
will not use SSL_V2_COMPATIBLE_HELLO with a proxy."

kaie said:

"Looking at Nelsons explanations, chatting with Nelson, and looking at the
current Mozilla+PSM code, I come to the following statements:

PSM currently only has one place in the code, where it tries to disable SSL2
compatible hellos.

PSM is currently not making a difference between connections that use STARTTLS
or switch a proxy connection to SSL/TLS. It prepares sockets the same way.

With STARTTLS, it is necessary to disable SSL_V2_COMPATIBLE_HELLOS.
With https over a proxy, there is no SSL protocol restriction for the https part.

Currently, PSM is unable to distinguish, whether STARTTLS or a "protocol over
proxy" is happening.

In order to solve the problem of this bug, and to not break anything else (smtp
over ssl), we must add the ability to distinguish.

Whenever the application is going to do STARTTLS, PSM should disable SSL2
compatible hellos, and because there is no need to use SSL2, it should disable
SSL2 at all.

Whenever the application is intending to speak SSL over a proxy, it should not
disable any SSL2 options (unless the user in general disabled SSL2), in order to
be able to speak with any server.


I made a simple change, and did neither disable SSL2 nor the "hellos".
By doing so, I could successfully connect to the site through a proxy.

But we can't take that simple fix, because it breaks SMTP-over-SSL."

nelsonb said:

are you proposing to always leave ssl2 fully enabled when using a proxy?  
What effect will this have on (say) imaps or smpts over a proxy?
Or are we certain that imaps and smpts _never_ use a proxy?"

kaie said:

"At least I was unable to find code in the tree that would use a proxy with email

But even if it were used, I suggest an implementation that would support that.

I did not say, to leave it always enabled, whenever a proxy it detected.
I wanted to say, I don't care whether a proxy is used or not.
I would not do anything special when a proxy is used.

But if the application informs PSM, that STARTTLS will be used on the socket, we
will disable SSL2 and the compatible hellos, regardless of whether a proxy is used."
No longer blocks: 88381


16 years ago
Blocks: 88381

Comment 2

16 years ago
It turns out that PSM code is not as wrong as I thought.
I have hope that the fix is much simpler.

Confusion 1)
What is called "tlsstepup" in PSM should be called "starttls".

Confusion 2)
"tlsstepup" aka "starttls" has nothing to do with proxies.

Result of Confusion:

In bug 89500 you changed how http connections use SSL. When you detect that a
proxy is configured, you use a "tlsstepup" socket.

But using "tlsstepup" (aka "starttls") must not be used with https, because it
disables a SSL protocol option (v2 compatible hello), which is required for
https to work correctly.

Comment 3

16 years ago
Created attachment 86789 [details] [diff] [review]
Patch to http protocol handler / never use start tls logic (currently uncorrectly named as tlsstepup)

Using this patch, I see correct behaviour when trying to connect to a SSL v2
only site using a proxy.

- have a proxy for SSL configured
- go to

Without the patch, connecting does not succeed, but seems to be stale.

With the patch, and having the SSL2 pref enabled, connecting succeeds.

With the patch, and having the SSL2 pref disabled, the correct error message is


16 years ago
No longer blocks: 126944

Comment 4

16 years ago
Kai, Darin.  Is this something we want for RTM?

Comment 5

16 years ago
I think we should definitively take it for RTM.
- We know that there are many problems with https over proxies, and from what I
learned from Nelson this patch is the right thing to do.
- Testing the known bugs with https over proxies seem all to be fixed by this patch.
- This patch can not have any impact besides https over proxies, so I consider
it low risk.

Darin, Bradley, can you please r/sr?

If you want me to, I can provide test builds for Windows and Linux having this
patch applied, and we can ask QA to test.
Comment on attachment 86789 [details] [diff] [review]
Patch to http protocol handler / never use start tls logic (currently uncorrectly named as tlsstepup)


kaie explained this to me. I can't remember why I changed this in bug 89500 -
if I could, I'd get kaie to change the docs I must have seen.
Attachment #86789 - Flags: review+

Comment 7

16 years ago
Comment on attachment 86789 [details] [diff] [review]
Patch to http protocol handler / never use start tls logic (currently uncorrectly named as tlsstepup)

Attachment #86789 - Flags: superreview+

Comment 8

16 years ago
kaie: can you please trim the { }'s that are no longer required.  thx!

Comment 9

16 years ago
Created attachment 87199 [details] [diff] [review]
Updated fix 

This has just two unnecessary brackets removed, as requested by Darin.
Attachment #86789 - Attachment is obsolete: true

Comment 10

16 years ago
Comment on attachment 87199 [details] [diff] [review]
Updated fix 

Carrying forward r=bbaetz and sr=darin
Attachment #87199 - Flags: superreview+
Attachment #87199 - Flags: review+

Comment 11

16 years ago
I'd say, let's land it for RTM.
Keywords: adt1.0.1, mozilla1.0.1, nsbeta1+
Whiteboard: [adt1 rtm]

Comment 12

16 years ago
*** Bug 102098 has been marked as a duplicate of this bug. ***


16 years ago
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 13

16 years ago
Checked in to trunk.

Comment 14

16 years ago
John, can you verify this fix on the trunk.  Thx.


16 years ago
No longer blocks: 87902


16 years ago
No longer blocks: 88381

Comment 15

16 years ago
*** Bug 87902 has been marked as a duplicate of this bug. ***

Comment 16

16 years ago
*** Bug 88381 has been marked as a duplicate of this bug. ***


16 years ago
No longer blocks: 92742

Comment 17

16 years ago
*** Bug 92742 has been marked as a duplicate of this bug. ***

Comment 18

16 years ago
Verified on trunk.
Priority: -- → P2
Version: unspecified → 2.3

Comment 19

16 years ago
adt1.0.1+ (on ADT's behalf) approval for checkin on the 1.0 branch. pls check
this in asap, then add the keyword "fixed1.0.1".
Keywords: approval
Whiteboard: [adt1 rtm] → [adt1 rtm] [ETA 06/20]

Comment 20

16 years ago
actually changing keyword to +
Keywords: adt1.0.1 → adt1.0.1+


16 years ago
Attachment #87199 - Flags: approval+

Comment 21

16 years ago
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+"
keyword and add the "fixed1.0.1" keyword.
Keywords: mozilla1.0.1 → mozilla1.0.1+

Comment 22

16 years ago
Checked in to 1_0 branch.
Keywords: adt1.0.1+, mozilla1.0.1+ → fixed1.0.1

Comment 23

16 years ago
verified on 6/20 branch.
Keywords: fixed1.0.1 → verified1.0.1
*** Bug 154893 has been marked as a duplicate of this bug. ***

Comment 25

16 years ago
*** Bug 163632 has been marked as a duplicate of this bug. ***


13 years ago
Component: Security: UI → Security: UI
Product: PSM → Core


10 years ago
Version: psm2.3 → 1.0 Branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.