mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-01 14:18:36 +00:00
When ECH is enabled without a static config, the HTTPS record query for the ECH config list went through the DNS rules instead of the domain resolver, and the migration of outbound DNS rule items to the domain resolver left no way to select a DNS server for it. A rule rejecting HTTPS records refused the query, and a default DNS server detoured through the same outbound waited for its own connection until the query timed out. Send the query to the domain resolver of the dial fields, then the default domain resolver, then the only DNS server, and fail it when none of them is available. DNS servers must set their own domain resolver for it, as they do for a domain server address.
33 lines
1.5 KiB
Go
33 lines
1.5 KiB
Go
//go:build !with_utls
|
|
|
|
package tls
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sagernet/sing-box/log"
|
|
"github.com/sagernet/sing-box/option"
|
|
E "github.com/sagernet/sing/common/exceptions"
|
|
"github.com/sagernet/sing/common/logger"
|
|
)
|
|
|
|
func NewUTLSClient(ctx context.Context, logger logger.ContextLogger, serverAddress string, options option.OutboundTLSOptions) (Config, error) {
|
|
return newUTLSClient(ctx, logger, serverAddress, options, false, nil, false)
|
|
}
|
|
|
|
func newUTLSClient(ctx context.Context, logger logger.ContextLogger, serverAddress string, options option.OutboundTLSOptions, allowEmptyServerName bool, domainResolver *option.DomainResolveOptions, directResolver bool) (Config, error) {
|
|
return nil, E.New(`uTLS is not included in this build, rebuild with -tags with_utls`)
|
|
}
|
|
|
|
func NewRealityClient(ctx context.Context, logger logger.ContextLogger, serverAddress string, options option.OutboundTLSOptions) (Config, error) {
|
|
return newRealityClient(ctx, logger, serverAddress, options, false)
|
|
}
|
|
|
|
func newRealityClient(ctx context.Context, logger logger.ContextLogger, serverAddress string, options option.OutboundTLSOptions, allowEmptyServerName bool) (Config, error) {
|
|
return nil, E.New(`uTLS, which is required by reality is not included in this build, rebuild with -tags with_utls`)
|
|
}
|
|
|
|
func NewRealityServer(ctx context.Context, logger log.Logger, options option.InboundTLSOptions) (ServerConfig, error) {
|
|
return nil, E.New(`uTLS, which is required by reality is not included in this build, rebuild with -tags with_utls`)
|
|
}
|