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
11fa8472
Commit
11fa8472
authored
Nov 06, 2012
by
Philip Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't store no_check_cert; fetch it on demand
parent
2f7538ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
24 deletions
+16
-24
src/transports/http.c
+7
-11
src/transports/winhttp.c
+9
-13
No files found.
src/transports/http.c
View file @
11fa8472
...
...
@@ -54,8 +54,7 @@ typedef struct {
git_cred
*
cred
;
http_authmechanism_t
auth_mechanism
;
unsigned
connected
:
1
,
use_ssl
:
1
,
no_check_cert
:
1
;
use_ssl
:
1
;
/* Parser structures */
http_parser
parser
;
...
...
@@ -572,9 +571,14 @@ static int http_action(
if
(
!
t
->
connected
||
!
http_should_keep_alive
(
&
t
->
parser
))
{
if
(
t
->
use_ssl
)
{
int
transport_flags
;
if
(
t
->
owner
->
parent
.
read_flags
(
&
t
->
owner
->
parent
,
&
transport_flags
)
<
0
)
return
-
1
;
flags
|=
GITNO_CONNECT_SSL
;
if
(
t
->
no_check_cert
)
if
(
GIT_TRANSPORTFLAGS_NO_CHECK_CERT
&
transport_flags
)
flags
|=
GITNO_CONNECT_SSL_NO_CHECK_CERT
;
}
...
...
@@ -635,14 +639,6 @@ int git_smart_subtransport_http(git_smart_subtransport **out,
t
->
parent
.
action
=
http_action
;
t
->
parent
.
free
=
http_free
;
/* Read the flags from the owning transport */
if
(
owner
->
read_flags
&&
owner
->
read_flags
(
owner
,
&
flags
)
<
0
)
{
git__free
(
t
);
return
-
1
;
}
t
->
no_check_cert
=
flags
&
GIT_TRANSPORTFLAGS_NO_CHECK_CERT
;
t
->
settings
.
on_header_field
=
on_header_field
;
t
->
settings
.
on_header_value
=
on_header_value
;
t
->
settings
.
on_headers_complete
=
on_headers_complete
;
...
...
src/transports/winhttp.c
View file @
11fa8472
...
...
@@ -62,8 +62,7 @@ typedef struct {
int
auth_mechanism
;
HINTERNET
session
;
HINTERNET
connection
;
unsigned
use_ssl
:
1
,
no_check_cert
:
1
;
unsigned
use_ssl
:
1
;
}
winhttp_subtransport
;
static
int
apply_basic_credential
(
HINTERNET
request
,
git_cred
*
cred
)
...
...
@@ -183,8 +182,14 @@ static int winhttp_stream_connect(winhttp_stream *s)
}
/* If requested, disable certificate validation */
if
(
t
->
use_ssl
&&
t
->
no_check_cert
)
{
if
(
!
WinHttpSetOption
(
s
->
request
,
WINHTTP_OPTION_SECURITY_FLAGS
,
if
(
t
->
use_ssl
)
{
int
flags
;
if
(
t
->
owner
->
parent
.
read_flags
(
&
t
->
owner
->
parent
,
&
flags
)
<
0
)
goto
on_error
;
if
((
GIT_TRANSPORTFLAGS_NO_CHECK_CERT
&
flags
)
&&
!
WinHttpSetOption
(
s
->
request
,
WINHTTP_OPTION_SECURITY_FLAGS
,
(
LPVOID
)
&
no_check_cert_flags
,
sizeof
(
no_check_cert_flags
)))
{
giterr_set
(
GITERR_OS
,
"Failed to set options to ignore cert errors"
);
goto
on_error
;
...
...
@@ -608,7 +613,6 @@ static void winhttp_free(git_smart_subtransport *smart_transport)
int
git_smart_subtransport_http
(
git_smart_subtransport
**
out
,
git_transport
*
owner
)
{
winhttp_subtransport
*
t
;
int
flags
;
if
(
!
out
)
return
-
1
;
...
...
@@ -620,14 +624,6 @@ int git_smart_subtransport_http(git_smart_subtransport **out, git_transport *own
t
->
parent
.
action
=
winhttp_action
;
t
->
parent
.
free
=
winhttp_free
;
/* Read the flags from the owning transport */
if
(
owner
->
read_flags
&&
owner
->
read_flags
(
owner
,
&
flags
)
<
0
)
{
git__free
(
t
);
return
-
1
;
}
t
->
no_check_cert
=
flags
&
GIT_TRANSPORTFLAGS_NO_CHECK_CERT
;
*
out
=
(
git_smart_subtransport
*
)
t
;
return
0
;
}
...
...
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