Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
bf6f7ad2
Commit
bf6f7ad2
authored
Sep 30, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: correctly detect HTTPS usage
parent
467e2cb1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/transports/winhttp.c
+14
-2
No files found.
src/transports/winhttp.c
View file @
bf6f7ad2
...
...
@@ -325,6 +325,9 @@ static int userpass_from_url(wchar_t **user, int *user_len,
return
0
;
}
#define SCHEME_HTTP "http://"
#define SCHEME_HTTPS "https://"
static
int
winhttp_stream_connect
(
winhttp_stream
*
s
)
{
winhttp_subtransport
*
t
=
OWNING_SUBTRANSPORT
(
s
);
...
...
@@ -388,6 +391,15 @@ static int winhttp_stream_connect(winhttp_stream *s)
WINHTTP_PROXY_INFO
proxy_info
;
wchar_t
*
proxy_wide
;
if
(
!
git__prefixcmp
(
proxy_url
,
SCHEME_HTTP
))
{
t
->
proxy_connection_data
.
use_ssl
=
false
;
}
else
if
(
!
git__prefixcmp
(
proxy_url
,
SCHEME_HTTPS
))
{
t
->
proxy_connection_data
.
use_ssl
=
true
;
}
else
{
giterr_set
(
GITERR_NET
,
"invalid URL: '%s'"
,
proxy_url
);
return
-
1
;
}
if
((
error
=
gitno_extract_url_parts
(
&
t
->
proxy_connection_data
.
host
,
&
t
->
proxy_connection_data
.
port
,
NULL
,
&
t
->
proxy_connection_data
.
user
,
&
t
->
proxy_connection_data
.
pass
,
proxy_url
,
NULL
))
<
0
)
goto
on_error
;
...
...
@@ -398,9 +410,9 @@ static int winhttp_stream_connect(winhttp_stream *s)
}
if
(
t
->
proxy_connection_data
.
use_ssl
)
git_buf_
puts
(
&
processed_url
,
"https://"
);
git_buf_
PUTS
(
&
processed_url
,
SCHEME_HTTPS
);
else
git_buf_
puts
(
&
processed_url
,
"http://"
);
git_buf_
PUTS
(
&
processed_url
,
SCHEME_HTTP
);
git_buf_puts
(
&
processed_url
,
t
->
proxy_connection_data
.
host
);
if
(
t
->
proxy_connection_data
.
port
)
...
...
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