Skip to content

Commit

Permalink
Fix cloudflare-tls usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Aug 31, 2023
1 parent 19daa87 commit ba18d54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ech/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package quic
import (
"bytes"
"context"
stdTLS "crypto/tls"
"errors"
"fmt"
"io"
Expand All @@ -11,6 +12,7 @@ import (
"sync"
"sync/atomic"
"time"
"unsafe"

"github.com/sagernet/cloudflare-tls"
"github.com/sagernet/quic-go/congestion"
Expand Down Expand Up @@ -679,7 +681,8 @@ func (s *connection) ConnectionState() ConnectionState {
s.connStateMutex.Lock()
defer s.connStateMutex.Unlock()
cs := s.cryptoStreamHandler.ConnectionState()
//s.connState.TLS = cs.ConnectionState
// s.connState.TLS = cs.ConnectionState
s.connState.TLS = *(*stdTLS.ConnectionState)(unsafe.Pointer(&cs.ConnectionState))
s.connState.Used0RTT = cs.Used0RTT
return s.connState
}
Expand Down

0 comments on commit ba18d54

Please sign in to comment.