@@ -114,7 +114,7 @@ func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) {
114114 o .RemoteURL = r .c .URLs [len (r .c .URLs )- 1 ]
115115 }
116116
117- s , err := newSendPackSession (o .RemoteURL , o .Auth , o .InsecureSkipTLS , o .CABundle , o .ProxyOptions )
117+ s , err := newSendPackSession (o .RemoteURL , o .Auth , o .InsecureSkipTLS , o .ClientCert , o . ClientKey , o . CABundle , o .ProxyOptions )
118118 if err != nil {
119119 return err
120120 }
@@ -416,7 +416,7 @@ func (r *Remote) fetch(ctx context.Context, o *FetchOptions) (sto storer.Referen
416416 o .RemoteURL = r .c .URLs [0 ]
417417 }
418418
419- s , err := newUploadPackSession (o .RemoteURL , o .Auth , o .InsecureSkipTLS , o .CABundle , o .ProxyOptions )
419+ s , err := newUploadPackSession (o .RemoteURL , o .Auth , o .InsecureSkipTLS , o .ClientCert , o . ClientKey , o . CABundle , o .ProxyOptions )
420420 if err != nil {
421421 return nil , err
422422 }
@@ -532,31 +532,33 @@ func depthChanged(before []plumbing.Hash, s storage.Storer) (bool, error) {
532532 return false , nil
533533}
534534
535- func newUploadPackSession (url string , auth transport.AuthMethod , insecure bool , cabundle []byte , proxyOpts transport.ProxyOptions ) (transport.UploadPackSession , error ) {
536- c , ep , err := newClient (url , insecure , cabundle , proxyOpts )
535+ func newUploadPackSession (url string , auth transport.AuthMethod , insecure bool , clientCert , clientKey , caBundle []byte , proxyOpts transport.ProxyOptions ) (transport.UploadPackSession , error ) {
536+ c , ep , err := newClient (url , insecure , clientCert , clientKey , caBundle , proxyOpts )
537537 if err != nil {
538538 return nil , err
539539 }
540540
541541 return c .NewUploadPackSession (ep , auth )
542542}
543543
544- func newSendPackSession (url string , auth transport.AuthMethod , insecure bool , cabundle []byte , proxyOpts transport.ProxyOptions ) (transport.ReceivePackSession , error ) {
545- c , ep , err := newClient (url , insecure , cabundle , proxyOpts )
544+ func newSendPackSession (url string , auth transport.AuthMethod , insecure bool , clientCert , clientKey , caBundle []byte , proxyOpts transport.ProxyOptions ) (transport.ReceivePackSession , error ) {
545+ c , ep , err := newClient (url , insecure , clientCert , clientKey , caBundle , proxyOpts )
546546 if err != nil {
547547 return nil , err
548548 }
549549
550550 return c .NewReceivePackSession (ep , auth )
551551}
552552
553- func newClient (url string , insecure bool , cabundle []byte , proxyOpts transport.ProxyOptions ) (transport.Transport , * transport.Endpoint , error ) {
553+ func newClient (url string , insecure bool , clientCert , clientKey , caBundle []byte , proxyOpts transport.ProxyOptions ) (transport.Transport , * transport.Endpoint , error ) {
554554 ep , err := transport .NewEndpoint (url )
555555 if err != nil {
556556 return nil , nil , err
557557 }
558558 ep .InsecureSkipTLS = insecure
559- ep .CaBundle = cabundle
559+ ep .ClientCert = clientCert
560+ ep .ClientKey = clientKey
561+ ep .CaBundle = caBundle
560562 ep .Proxy = proxyOpts
561563
562564 c , err := client .NewClient (ep )
@@ -1356,7 +1358,7 @@ func (r *Remote) list(ctx context.Context, o *ListOptions) (rfs []*plumbing.Refe
13561358 return nil , ErrEmptyUrls
13571359 }
13581360
1359- s , err := newUploadPackSession (r .c .URLs [0 ], o .Auth , o .InsecureSkipTLS , o .CABundle , o .ProxyOptions )
1361+ s , err := newUploadPackSession (r .c .URLs [0 ], o .Auth , o .InsecureSkipTLS , o .ClientCert , o . ClientKey , o . CABundle , o .ProxyOptions )
13601362 if err != nil {
13611363 return nil , err
13621364 }
0 commit comments