Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
go-sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
id
go-sso
Commits
f0382112
Commit
f0382112
authored
7 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Add option to sso-proxy to set SSL server_name explicitly
parent
ff7a1048
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
proxy/proxy.go
+8
-0
8 additions, 0 deletions
proxy/proxy.go
proxy/proxy_test.go
+1
-2
1 addition, 2 deletions
proxy/proxy_test.go
with
9 additions
and
2 deletions
proxy/proxy.go
+
8
−
0
View file @
f0382112
...
...
@@ -20,6 +20,7 @@ import (
type
Backend
struct
{
Host
string
`yaml:"host"`
Upstream
[]
string
`yaml:"upstream"`
ServerName
string
`yaml:"tls_server_name"`
ClientTLSConfig
*
clientutil
.
TLSClientConfig
`yaml:"client_tls"`
AllowedGroups
[]
string
`yaml:"allowed_groups"`
...
...
@@ -45,6 +46,13 @@ func (b *Backend) newHandler(ssow *httpsso.SSOWrapper) (http.Handler, error) {
if
err
!=
nil
{
return
nil
,
err
}
// By setting the ServerName on the tls.Config, we
// hope to decouple TLS certificate verification from
// the details of the HTTP Host header included in the
// request, so that the transport layer will work
// regardless of the HTTP request details.
tlsConfig
.
ServerName
=
b
.
ServerName
}
proxy
.
Transport
=
clientutil
.
NewTransport
(
b
.
Upstream
,
tlsConfig
,
nil
)
...
...
This diff is collapsed.
Click to expand it.
proxy/proxy_test.go
+
1
−
2
View file @
f0382112
package
proxy
import
(
"crypto/rand"
"crypto/tls"
"io"
"io/ioutil"
...
...
@@ -32,7 +31,7 @@ func TestProxy(t *testing.T) {
}
defer
os
.
RemoveAll
(
tmpdir
)
pub
,
priv
,
err
:=
ed25519
.
GenerateKey
(
rand
.
Reader
)
pub
,
priv
,
err
:=
ed25519
.
GenerateKey
(
nil
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment