Merge lp:~openerp-dev/openobject-addons/6.1-opw-590713-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-590713-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 126 lines (+45/-4)
5 files modified
mail/mail_message.py (+2/-1)
plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin.sln (+2/-2)
plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs (+9/-1)
plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.Designer.cs (+1/-0)
plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.cs (+31/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-590713-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+159154@code.launchpad.net

Description of the change

Hi,

Currently, the OpenERP Outlook plugin is not working if used with 'SSL (https)', a warning message is being shown by Outlook saying,
'The underlying connection was closed: Could not establish trust relation for the SSL/TLS secure channel.'

Steps:
Install the OpenERP Outlook plugin, Launch Outlook, Open menu OpenERP -> Configuration, click on 'Change' button and provide value for 'Server' and 'Port(443 for SSL)' and check 'SSL (https)', clicking on 'OK' will result in above message.

This branch will fix this issue. Courtesy: Atul Patel.

Note for the users: As HTTPS support was removed from OpenERP V6.1, one need to configure reverse proxy(such as Apache, Nginx or lighttpd) for OpenERP where your OpenERP server is running.

Changes from the branch, https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-584763-rgo has also been included in this branch.

Kindly review the fix.

Thanks.

To post a comment you must log in.

Unmerged revisions

7201. By Atul Patel(OpenERP)

[FIX] plugin_outlook: OpenERP outlook plugin does not work when used with SSL(https). (Maintenance Case: 590713)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mail/mail_message.py'
2--- mail/mail_message.py 2012-09-24 14:02:33 +0000
3+++ mail/mail_message.py 2013-04-16 13:29:34 +0000
4@@ -437,7 +437,8 @@
5 if 'text/html' in msg.get('content-type', ''):
6 msg['body_html'] = body
7 msg['subtype'] = 'html'
8- body = tools.html2plaintext(body)
9+ if msg['body_html'] != '':
10+ body = tools.html2plaintext(body)
11 msg['body_text'] = tools.ustr(body, encoding, errors='replace')
12
13 attachments = []
14
15=== modified file 'plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin.sln'
16--- plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin.sln 2011-12-12 13:40:43 +0000
17+++ plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin.sln 2013-04-16 13:29:34 +0000
18@@ -1,6 +1,6 @@
19 
20-Microsoft Visual Studio Solution File, Format Version 10.00
21-# Visual Studio 2008
22+Microsoft Visual Studio Solution File, Format Version 11.00
23+# Visual Studio 2010
24 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenERPOutlookPlugin", "OpenERPOutlookPlugin\OpenERPOutlookPlugin.csproj", "{F4B2219B-F235-400F-81B4-92F15250BBA4}"
25 EndProject
26 Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "OpenERPOutlookPluginSetup", "OpenERPOutlookPluginSetup\OpenERPOutlookPluginSetup.vdproj", "{96333293-0156-4998-9065-42721CEB0368}"
27
28=== modified file 'plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs'
29--- plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs 2011-12-09 14:28:39 +0000
30+++ plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/OpenERPOutlookPlugin.cs 2013-04-16 13:29:34 +0000
31@@ -144,7 +144,15 @@
32 OpenERPConnect openerp_connect = openerp_outlook.Connection;
33 ArrayList args = new ArrayList();
34 Hashtable vals = new Hashtable();
35- string email = Tools.GetHeader(mail); //TODO: Outlook.MailItem Should be Converted into MIME Message
36+ string email;
37+ if (Tools.GetHeader(mail) != null)
38+ {
39+ email = Tools.GetHeader(mail); //TODO: Outlook.MailItem Should be Converted into MIME Message
40+ }
41+ else
42+ {
43+ email = "";
44+ }
45 args.Add(model);
46 args.Add(email.ToString());
47 args.Add(thread_id);
48
49=== modified file 'plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.Designer.cs'
50--- plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.Designer.cs 2011-12-09 14:28:39 +0000
51+++ plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.Designer.cs 2013-04-16 13:29:34 +0000
52@@ -64,6 +64,7 @@
53 this.chkSSL.TabIndex = 19;
54 this.chkSSL.Text = "SSL (https)";
55 this.chkSSL.UseVisualStyleBackColor = true;
56+ this.chkSSL.CheckedChanged += new System.EventHandler(this.chkSSL_CheckedChanged);
57 //
58 // txt_server_port
59 //
60
61=== modified file 'plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.cs'
62--- plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.cs 2011-12-09 14:28:39 +0000
63+++ plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPlugin/frm_openerp_connection.cs 2013-04-16 13:29:34 +0000
64@@ -20,6 +20,13 @@
65 using System;
66 using System.Windows.Forms;
67 using OpenERPClient;
68+using System.Net;
69+using System.IO;
70+using System.Text;
71+using System.Security;
72+using System.Net;
73+using System.Security.Cryptography.X509Certificates;
74+using System.Net.Security;
75
76 namespace OpenERPOutlookPlugin
77 {
78@@ -51,6 +58,15 @@
79 }
80
81
82+ public static bool ValidateServerCertificate(
83+ object sender,
84+ X509Certificate certificate,
85+ X509Chain chain,
86+ SslPolicyErrors sslPolicyErrors)
87+ {
88+ // Somehow the cert always has PolicyErrors so I am returning true regardless.
89+ return true;
90+ }
91 private void btn_server_ok_Click(object sender, EventArgs e)
92 {
93 try
94@@ -59,6 +75,10 @@
95 OpenERPConnect openerp_connect = openerp_outlook.Connection;
96 string url = Tools.JoinURL(this.txt_server_host.Text, this.txt_server_port.Text, this.chkSSL.Checked);
97 this.txtServerURL.Text = url;
98+ if (this.chkSSL.Checked)
99+ {
100+ ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateServerCertificate);
101+ }
102 openerp_connect.check_connectivity();
103 this.Close();
104 }
105@@ -75,5 +95,16 @@
106 }
107
108
109+ private void chkSSL_CheckedChanged(object sender, EventArgs e)
110+ {
111+ if (this.chkSSL.Checked)
112+ {
113+ txt_server_port.Text = "443";
114+ }
115+ else
116+ {
117+ txt_server_port.Text = "8069";
118+ }
119+ }
120 }
121 }
122
123=== modified file 'plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup32.msi'
124Binary files plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup32.msi 2012-02-16 17:21:36 +0000 and plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup32.msi 2013-04-16 13:29:34 +0000 differ
125=== modified file 'plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup64.msi'
126Binary files plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup64.msi 2012-02-16 17:21:36 +0000 and plugin_outlook/static/openerp-outlook-plugin/OpenERPOutlookPluginSetup64.msi 2013-04-16 13:29:34 +0000 differ