Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
7d2ac48d
Commit
7d2ac48d
authored
Nov 10, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also validate that the certificate contains a private key
parent
d28143e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
preferences.py
blink/preferences.py
+4
-2
No files found.
blink/preferences.py
View file @
7d2ac48d
...
@@ -15,7 +15,7 @@ from PyQt4.QtGui import QActionGroup, QButtonGroup, QFileDialog, QListView, QLi
...
@@ -15,7 +15,7 @@ from PyQt4.QtGui import QActionGroup, QButtonGroup, QFileDialog, QListView, QLi
from
application
import
log
from
application
import
log
from
application.notification
import
IObserver
,
NotificationCenter
from
application.notification
import
IObserver
,
NotificationCenter
from
application.python.util
import
Null
from
application.python.util
import
Null
from
gnutls.crypto
import
X509Certificate
from
gnutls.crypto
import
X509Certificate
,
X509PrivateKey
from
gnutls.errors
import
GNUTLSError
from
gnutls.errors
import
GNUTLSError
from
zope.interface
import
implements
from
zope.interface
import
implements
...
@@ -972,7 +972,9 @@ class PreferencesWindow(base_class, ui_class):
...
@@ -972,7 +972,9 @@ class PreferencesWindow(base_class, ui_class):
cert_path
=
os
.
path
.
normpath
(
cert_path
)
cert_path
=
os
.
path
.
normpath
(
cert_path
)
if
cert_path
!=
account
.
tls
.
certificate
:
if
cert_path
!=
account
.
tls
.
certificate
:
try
:
try
:
X509Certificate
(
open
(
cert_path
)
.
read
())
contents
=
open
(
cert_path
)
.
read
()
X509Certificate
(
contents
)
X509PrivateKey
(
contents
)
except
(
OSError
,
IOError
),
e
:
except
(
OSError
,
IOError
),
e
:
QMessageBox
.
critical
(
self
,
u"TLS Certificate Error"
,
u"The certificate file could not be opened:
%
s"
%
e
.
strerror
)
QMessageBox
.
critical
(
self
,
u"TLS Certificate Error"
,
u"The certificate file could not be opened:
%
s"
%
e
.
strerror
)
except
GNUTLSError
,
e
:
except
GNUTLSError
,
e
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment