Skip to content

Commit 8f04654

Browse files
fixed non-proxy auth && godoc
1 parent 199cfe5 commit 8f04654

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ca.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"time"
1414
)
1515

16+
// Default certificate.
1617
var DefaultCaCert = []byte(`-----BEGIN CERTIFICATE-----
1718
MIIFkzCCA3ugAwIBAgIJAKEbW2ujNjX9MA0GCSqGSIb3DQEBCwUAMGAxCzAJBgNV
1819
BAYTAlRSMREwDwYDVQQIDAhJc3RhbmJ1bDEVMBMGA1UECgwMZ28taHR0cHByb3h5
@@ -46,6 +47,7 @@ Ii9Vb07WDMQXou0ZZs7rnjAKo+sfFElTFewtS1wif4ZYBUJN1ln9G8qKaxbAiElm
4647
MgzNfZ7WlnaJf2rfHJbvK9VqJ9z6dLRYPjCHhakJBtzsMdxysEGJ
4748
-----END CERTIFICATE-----`)
4849

50+
// Default key.
4951
var DefaultCaKey = []byte(`-----BEGIN RSA PRIVATE KEY-----
5052
MIIJKQIBAAKCAgEA18cwaaZzhdDEpUXpR9pkYRqsSdT30WhynFhFtcaBOf4eYdpt
5153
AJWL2ipo3Ac6bh+YgWfywG4prrSfWOJl+dQ59w439vLek/waBcEeFx+wJ6PFu0ur

doing.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func doAccept(ctx *Context, w http.ResponseWriter, r *http.Request) bool {
3030
}
3131

3232
func doAuth(ctx *Context, w http.ResponseWriter, r *http.Request) bool {
33+
if r.Method != "CONNECT" && !r.URL.IsAbs() {
34+
return false
35+
}
3336
if ctx.Prx.OnAuth == nil {
3437
return false
3538
}

0 commit comments

Comments
 (0)