back end changes for "POP over SSL". bug #68516.

thanks to kai.engert@gmx.de for the patch.  r=sspitzer, sr=mscott
This commit is contained in:
sspitzer%netscape.com 2001-08-06 20:12:31 +00:00
Родитель 00899603d7
Коммит acfb6f42ec
3 изменённых файлов: 25 добавлений и 5 удалений

Просмотреть файл

@ -90,8 +90,8 @@ Contributors:
<groupbox>
<label value="&serverSettings.label;"/>
<vbox flex="1">
<checkbox iscontrolcontainer="true" hidable="true" wsm_persist="true" id="server.isSecure"
label="&isSecure.label;" hidefor="pop3" oncommand="secureSelect();"
<checkbox iscontrolcontainer="true" wsm_persist="true" id="server.isSecure"
label="&isSecure.label;" oncommand="secureSelect();"
pref="true" preftype="bool" prefattribute="value"
prefstring="mail.server.%serverkey%.isSecure"/>
<checkbox iscontrolcontainer="true" hidable="true" wsm_persist="true"

Просмотреть файл

@ -431,6 +431,8 @@ nsresult nsPop3Protocol::Initialize(nsIURI * aURL)
if (aURL)
{
PRBool isSecure = PR_FALSE;
// extract out message feedback if there is any.
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aURL);
if (mailnewsUrl)
@ -439,6 +441,10 @@ nsresult nsPop3Protocol::Initialize(nsIURI * aURL)
mailnewsUrl->GetStatusFeedback(getter_AddRefs(m_statusFeedback));
mailnewsUrl->GetServer(getter_AddRefs(server));
NS_ENSURE_TRUE(server, NS_MSG_INVALID_OR_MISSING_SERVER);
rv = server->GetIsSecure(&isSecure);
NS_ENSURE_SUCCESS(rv,rv);
m_pop3Server = do_QueryInterface(server);
if (m_pop3Server)
m_pop3Server->GetPop3CapabilityFlags(&m_pop3ConData->capability_flags);
@ -455,8 +461,13 @@ nsresult nsPop3Protocol::Initialize(nsIURI * aURL)
ir = do_QueryInterface(docshell);
}
// if the server is secure, pass in "ssl" for the last arg
rv = OpenNetworkSocket(aURL, nsnull, ir);
if (isSecure) {
rv = OpenNetworkSocket(aURL, "ssl-forcehandshake", ir);
}
else {
rv = OpenNetworkSocket(aURL, nsnull, ir);
}
if(NS_FAILED(rv))
return rv;
} // if we got a url...

Просмотреть файл

@ -48,6 +48,7 @@
#include "nsEscape.h"
#define POP3_PORT 110 // The IANA port for Pop3
#define SECURE_POP3_PORT 995 // The port for Pop3 over SSL
#define PREF_MAIL_ROOT_POP3 "mail.root.pop3"
@ -572,7 +573,15 @@ nsPop3Service::GetNeedToBuildSpecialFolderURIs(PRBool *needToBuildSpecialFolderU
NS_IMETHODIMP
nsPop3Service::GetDefaultServerPort(PRBool isSecure, PRInt32 *aPort)
{
return GetDefaultPort(aPort);
NS_ENSURE_ARG_POINTER(aPort);
nsresult rv = NS_OK;
if (isSecure)
*aPort = SECURE_POP3_PORT;
else
rv = GetDefaultPort(aPort);
return rv;
}
NS_IMETHODIMP