Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
6ef795e0
Commit
6ef795e0
authored
Jun 19, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manual mitm for oracle.com
parent
1e5d258e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
proxy.c
examples/proxy.c
+8
-0
No files found.
examples/proxy.c
View file @
6ef795e0
...
...
@@ -124,6 +124,13 @@ static int proxy_event_handler(struct mg_connection *conn, enum mg_event ev) {
return
try_to_serve_locally
(
conn
);
}
// Enable man-in-the-middle SSL mode for oracle.com
if
(
!
strcmp
(
conn
->
request_method
,
"CONNECT"
)
&&
!
strcmp
(
host
,
"oracle.com"
))
{
mg_terminate_ssl
(
conn
,
"ssl_cert.pem"
);
return
MG_MORE
;
}
return
MG_FALSE
;
case
MG_AUTH
:
return
MG_TRUE
;
...
...
@@ -168,6 +175,7 @@ int main(int argc, char *argv[]) {
// Create and configure proxy server
s_server
=
mg_create_server
(
NULL
,
&
proxy_event_handler
);
setopt
(
s_server
,
"enable_proxy"
,
"yes"
);
setopt
(
s_server
,
"document_root"
,
root
);
setopt
(
s_server
,
"listening_port"
,
port
);
setopt
(
s_server
,
"ssl_certificate"
,
cert
);
...
...
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