Skip to content

Commit 48d9935

Browse files
committed
Do not include HTTPS cert in EOS HTTP Client
Omit HTTPS cert in EOS HTTP Client, as this causes authentication issues on EOS < 5.2.28. When EOS receives a certificate, it will look for this cert in the gridmap file. If it is not found there, the whole authn flow is aborted and the user is mapped to nobody.
1 parent a41ea23 commit 48d9935

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Bugfix: no certs in EOS HTTP client
2+
3+
Omit HTTPS cert in EOS HTTP Client, as this causes authentication issues on EOS < 5.2.28.
4+
When EOS receives a certificate, it will look for this cert in the gridmap file.
5+
If it is not found there, the whole authn flow is aborted and the user is mapped to nobody.
6+
7+
8+
https://github.com/cs3org/reva/pull/4894

pkg/eosclient/eosgrpc/eoshttp.go

-21
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ package eosgrpc
2121
import (
2222
"bytes"
2323
"context"
24-
"crypto/tls"
25-
"errors"
2624
"fmt"
2725
"io"
2826
"net/http"
@@ -148,10 +146,6 @@ func NewEOSHTTPClient(opt *HTTPOptions) (*EOSHTTPClient, error) {
148146
}
149147

150148
opt.init()
151-
baseUrl, err := url.Parse(opt.BaseURL)
152-
if err != nil {
153-
return nil, errors.New("Failed to parse BaseURL")
154-
}
155149

156150
t := &http.Transport{
157151
MaxIdleConns: opt.MaxIdleConns,
@@ -161,21 +155,6 @@ func NewEOSHTTPClient(opt *HTTPOptions) (*EOSHTTPClient, error) {
161155
DisableCompression: true,
162156
}
163157

164-
if baseUrl.Scheme == "https" {
165-
cert, err := tls.LoadX509KeyPair(opt.ClientCertFile, opt.ClientKeyFile)
166-
if err != nil {
167-
return nil, err
168-
}
169-
t.TLSClientConfig = &tls.Config{
170-
Certificates: []tls.Certificate{cert},
171-
}
172-
}
173-
174-
// TODO: the error reporting of http.transport is insufficient
175-
// we may want to check manually at least the existence of the certfiles
176-
// The point is that also the error reporting of the context that calls this function
177-
// is weak
178-
179158
cl := &http.Client{
180159
Transport: t,
181160
CheckRedirect: func(req *http.Request, via []*http.Request) error {

0 commit comments

Comments
 (0)