Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
3747d4cf
Unverified
Commit
3747d4cf
authored
Sep 23, 2019
by
Ge Jun
Committed by
GitHub
Sep 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #883 from mesalock-linux/yj_mesalink_client_auth_fix
mesalink: bug fix for client authentication
parents
23bf4b79
8aeaf2b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
mesalink_ssl_helper.cpp
src/brpc/details/mesalink_ssl_helper.cpp
+6
-8
No files found.
src/brpc/details/mesalink_ssl_helper.cpp
View file @
3747d4cf
...
...
@@ -67,12 +67,10 @@ static int ParseSSLProtocols(const std::string& str_protocol) {
for
(;
sp
;
++
sp
)
{
butil
::
StringPiece
protocol
(
sp
.
field
(),
sp
.
length
());
protocol
.
trim_spaces
();
if
(
strncasecmp
(
protocol
.
data
(),
"SSLv3"
,
protocol
.
size
())
==
0
)
{
protocol_flag
|=
SSLv3
;
}
else
if
(
strncasecmp
(
protocol
.
data
(),
"TLSv1"
,
protocol
.
size
())
==
0
)
{
protocol_flag
|=
TLSv1
;
}
else
if
(
strncasecmp
(
protocol
.
data
(),
"TLSv1.1"
,
protocol
.
size
())
==
0
)
{
protocol_flag
|=
TLSv1_1
;
if
(
strncasecmp
(
protocol
.
data
(),
"SSLv3"
,
protocol
.
size
())
==
0
||
strncasecmp
(
protocol
.
data
(),
"TLSv1"
,
protocol
.
size
())
==
0
||
strncasecmp
(
protocol
.
data
(),
"TLSv1.1"
,
protocol
.
size
())
==
0
)
{
LOG
(
WARNING
)
<<
"Ignored insecure SSL/TLS protocol="
<<
protocol
;
}
else
if
(
strncasecmp
(
protocol
.
data
(),
"TLSv1.2"
,
protocol
.
size
())
==
0
)
{
protocol_flag
|=
TLSv1_2
;
}
else
{
...
...
@@ -244,8 +242,6 @@ static int LoadCertificate(SSL_CTX* ctx,
static
int
SetSSLOptions
(
SSL_CTX
*
ctx
,
const
std
::
string
&
ciphers
,
int
protocols
,
const
VerifyOptions
&
verify
)
{
if
(
verify
.
verify_depth
>
0
)
{
SSL_CTX_set_verify
(
ctx
,
(
SSL_VERIFY_PEER
|
SSL_VERIFY_FAIL_IF_NO_PEER_CERT
),
NULL
);
std
::
string
cafile
=
verify
.
ca_file_path
;
if
(
!
cafile
.
empty
())
{
if
(
SSL_CTX_load_verify_locations
(
ctx
,
cafile
.
c_str
(),
NULL
)
==
0
)
{
...
...
@@ -254,6 +250,8 @@ static int SetSSLOptions(SSL_CTX* ctx, const std::string& ciphers,
return
-
1
;
}
}
SSL_CTX_set_verify
(
ctx
,
(
SSL_VERIFY_PEER
|
SSL_VERIFY_FAIL_IF_NO_PEER_CERT
),
NULL
);
}
else
{
SSL_CTX_set_verify
(
ctx
,
SSL_VERIFY_NONE
,
NULL
);
}
...
...
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