Secure Socket Client Example▲
Sélectionnez
&
lt;?xml version=
"1.0"
encoding=
"UTF-8"
?&
gt;
&
lt;ui version=
"4.0"
&
gt;
&
lt;class
&
gt;SslErrors&
lt;/
class
&
gt;
&
lt;widget class
=
"QDialog"
name=
"SslErrors"
&
gt;
&
lt;property name=
"geometry"
&
gt;
&
lt;rect&
gt;
&
lt;x&
gt;0
&
lt;/
x&
gt;
&
lt;y&
gt;0
&
lt;/
y&
gt;
&
lt;width&
gt;371
&
lt;/
width&
gt;
&
lt;height&
gt;216
&
lt;/
height&
gt;
&
lt;/
rect&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"windowTitle"
&
gt;
&
lt;string&
gt;Unable To Validate The Connection&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;layout class
=
"QVBoxLayout"
&
gt;
&
lt;item&
gt;
&
lt;widget class
=
"QLabel"
name=
"label"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;&
amp;lt;html&
amp;gt;&
amp;lt;head&
amp;gt;&
amp;lt;meta name=&
amp;quot;qrichtext&
amp;quot; content=&
amp;quot;1
&
amp;quot; /&
amp;gt;&
amp;lt;style type=&
amp;quot;text/
css&
amp;quot;&
amp;gt;
p, li {
white-
space: pre-
wrap; }
&
amp;lt;/
style&
amp;gt;&
amp;lt;/
head&
amp;gt;&
amp;lt;body style=&
amp;quot; font-
family:'Sans Serif'; font-
size:9
pt; font-
weight:400
; font-
style:normal;&
amp;quot;&
amp;gt;
&
amp;lt;p style=&
amp;quot; margin-
top:0
px; margin-
bottom:0
px; margin-
left:0
px; margin-
right:0
px; -
qt-
block-
indent:0
; text-
indent:0
px;&
amp;quot;&
amp;gt;&
amp;lt;span style=&
amp;quot; font-
weight:600
; color:#ff0000;&
amp;quot;&
amp;gt;Warning&
amp;lt;/
span&
amp;gt;&
amp;lt;span style=&
amp;quot; color:#ff0000;&
amp;quot;&
amp;gt;:&
amp;lt;/
span&
amp;gt;&
amp;lt;span style=&
amp;quot; color:#000000
;&
amp;quot;&
amp;gt; One or
more errors with this
connection prevent validating the authenticity of the host you are connecting to. Please review the following list of errors, and
click &
amp;lt;/
span&
amp;gt;&
amp;lt;span style=&
amp;quot; color:#000000
;&
amp;quot;&
amp;gt;Ignore&
amp;lt;/
span&
amp;gt;&
amp;lt;span style=&
amp;quot; color:#000000
;&
amp;quot;&
amp;gt; to continue
, or
&
amp;lt;/
span&
amp;gt;&
amp;lt;span style=&
amp;quot; color:#000000
;&
amp;quot;&
amp;gt;Cancel&
amp;lt;/
span&
amp;gt;&
amp;lt;span style=&
amp;quot; color:#000000
;&
amp;quot;&
amp;gt; to abort the connection.&
amp;lt;/
span&
amp;gt;&
amp;lt;/
p&
amp;gt;&
amp;lt;/
body&
amp;gt;&
amp;lt;/
html&
amp;gt;&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"wordWrap"
&
gt;
&
lt;bool
&
gt;true
&
lt;/
bool
&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;item&
gt;
&
lt;widget class
=
"QListWidget"
name=
"sslErrorList"
&
gt;
&
lt;property name=
"wordWrap"
&
gt;
&
lt;bool
&
gt;true
&
lt;/
bool
&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;item&
gt;
&
lt;layout class
=
"QHBoxLayout"
&
gt;
&
lt;item&
gt;
&
lt;widget class
=
"QPushButton"
name=
"certificateChainButton"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;View Certificate Chain&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"autoDefault"
&
gt;
&
lt;bool
&
gt;false
&
lt;/
bool
&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;item&
gt;
&
lt;spacer&
gt;
&
lt;property name=
"orientation"
&
gt;
&
lt;enum
&
gt;Qt::
Horizontal&
lt;/
enum
&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"sizeHint"
stdset=
"0"
&
gt;
&
lt;size&
gt;
&
lt;width&
gt;40
&
lt;/
width&
gt;
&
lt;height&
gt;20
&
lt;/
height&
gt;
&
lt;/
size&
gt;
&
lt;/
property&
gt;
&
lt;/
spacer&
gt;
&
lt;/
item&
gt;
&
lt;item&
gt;
&
lt;widget class
=
"QPushButton"
name=
"pushButton"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;Ignore&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;item&
gt;
&
lt;widget class
=
"QPushButton"
name=
"pushButton_2"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;Cancel&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;/
layout&
gt;
&
lt;/
item&
gt;
&
lt;/
layout&
gt;
&
lt;/
widget&
gt;
&
lt;resources/&
gt;
&
lt;connections&
gt;
&
lt;connection&
gt;
&
lt;sender&
gt;pushButton&
lt;/
sender&
gt;
&
lt;signal&
gt;clicked()&
lt;/
signal&
gt;
&
lt;receiver&
gt;SslErrors&
lt;/
receiver&
gt;
&
lt;slot&
gt;accept()&
lt;/
slot&
gt;
&
lt;hints&
gt;
&
lt;hint type=
"sourcelabel"
&
gt;
&
lt;x&
gt;235
&
lt;/
x&
gt;
&
lt;y&
gt;185
&
lt;/
y&
gt;
&
lt;/
hint&
gt;
&
lt;hint type=
"destinationlabel"
&
gt;
&
lt;x&
gt;228
&
lt;/
x&
gt;
&
lt;y&
gt;287
&
lt;/
y&
gt;
&
lt;/
hint&
gt;
&
lt;/
hints&
gt;
&
lt;/
connection&
gt;
&
lt;connection&
gt;
&
lt;sender&
gt;pushButton_2&
lt;/
sender&
gt;
&
lt;signal&
gt;clicked()&
lt;/
signal&
gt;
&
lt;receiver&
gt;SslErrors&
lt;/
receiver&
gt;
&
lt;slot&
gt;reject()&
lt;/
slot&
gt;
&
lt;hints&
gt;
&
lt;hint type=
"sourcelabel"
&
gt;
&
lt;x&
gt;325
&
lt;/
x&
gt;
&
lt;y&
gt;192
&
lt;/
y&
gt;
&
lt;/
hint&
gt;
&
lt;hint type=
"destinationlabel"
&
gt;
&
lt;x&
gt;333
&
lt;/
x&
gt;
&
lt;y&
gt;231
&
lt;/
y&
gt;
&
lt;/
hint&
gt;
&
lt;/
hints&
gt;
&
lt;/
connection&
gt;
&
lt;/
connections&
gt;
&
lt;/
ui&
gt;