Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
33ac3eb5
Commit
33ac3eb5
authored
Jan 22, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/curl/Easy: add methods SetVerify{Host,Peer}()
parent
d56a51cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+2
-2
Easy.hxx
src/lib/curl/Easy.hxx
+8
-0
Request.hxx
src/lib/curl/Request.hxx
+8
-0
No files found.
src/input/plugins/CurlInputPlugin.cxx
View file @
33ac3eb5
...
...
@@ -432,8 +432,8 @@ CurlInputStream::InitEasy()
StringFormat
<
1024
>
(
"%s:%s"
,
proxy_user
,
proxy_password
).
c_str
());
request
->
Set
Option
(
CURLOPT_SSL_VERIFYPEER
,
verify_peer
?
1L
:
0L
);
request
->
Set
Option
(
CURLOPT_SSL_VERIFYHOST
,
verify_host
?
2L
:
0L
);
request
->
Set
VerifyPeer
(
verify_peer
);
request
->
Set
VerifyHost
(
verify_host
);
request
->
SetOption
(
CURLOPT_HTTPHEADER
,
request_headers
.
Get
());
}
...
...
src/lib/curl/Easy.hxx
View file @
33ac3eb5
...
...
@@ -136,6 +136,14 @@ public:
SetOption
(
CURLOPT_FAILONERROR
,
(
long
)
value
);
}
void
SetVerifyHost
(
bool
value
)
{
SetOption
(
CURLOPT_SSL_VERIFYHOST
,
value
?
2L
:
0L
);
}
void
SetVerifyPeer
(
bool
value
)
{
SetOption
(
CURLOPT_SSL_VERIFYPEER
,
(
long
)
value
);
}
void
SetConnectTimeout
(
long
timeout
)
{
SetOption
(
CURLOPT_CONNECTTIMEOUT
,
timeout
);
}
...
...
src/lib/curl/Request.hxx
View file @
33ac3eb5
...
...
@@ -120,6 +120,14 @@ public:
easy
.
SetRequestHeaders
(
request_headers
);
}
void
SetVerifyHost
(
bool
value
)
{
easy
.
SetVerifyHost
(
value
);
}
void
SetVerifyPeer
(
bool
value
)
{
easy
.
SetVerifyPeer
(
value
);
}
void
SetNoBody
(
bool
value
=
true
)
{
easy
.
SetNoBody
(
value
);
}
...
...
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