@@ -758,7 +758,7 @@ describe('Proxy structured producers', function () {
758758 } ) ;
759759 } ) ;
760760
761- it ( 'exports Shadowsocks shadow-tls plugin ALPN to sing-box shadowtls tls options ' , function ( ) {
761+ it ( 'exports Shadowsocks shadow-tls plugin TLS options to sing-box' , function ( ) {
762762 const [ proxy ] = ProxyUtils . parse ( `proxies:
763763 - name: SS ShadowTLS ALPN
764764 type: ss
@@ -768,6 +768,8 @@ describe('Proxy structured producers', function () {
768768 password: password
769769 plugin: shadow-tls
770770 client-fingerprint: chrome
771+ skip-cert-verify: true
772+ name-cert-verify: verify.example.com
771773 plugin-opts:
772774 host: cloud.tencent.com
773775 password: shadow_tls_password
@@ -776,7 +778,9 @@ describe('Proxy structured producers', function () {
776778 - h2
777779 - http/1.1` ) ;
778780
779- const output = loadProducedJson ( 'sing-box' , proxy ) ;
781+ const output = loadProducedJson ( 'sing-box' , proxy , {
782+ 'include-unsupported-proxy' : true ,
783+ } ) ;
780784
781785 expect ( output . outbounds ) . to . have . length ( 2 ) ;
782786 expectSubset ( output . outbounds [ 0 ] , {
@@ -796,6 +800,8 @@ describe('Proxy structured producers', function () {
796800 tls : {
797801 enabled : true ,
798802 server_name : 'cloud.tencent.com' ,
803+ insecure : true ,
804+ certificate_server_name : 'verify.example.com' ,
799805 alpn : [ 'h2' , 'http/1.1' ] ,
800806 utls : {
801807 enabled : true ,
@@ -4449,6 +4455,28 @@ describe('Proxy structured producers', function () {
44494455 } ) ;
44504456 } ) ;
44514457
4458+ it ( 'emits sing-box certificate_server_name only with unsupported proxies enabled' , function ( ) {
4459+ const proxy = {
4460+ type : 'vless' ,
4461+ name : 'Certificate Server Name' ,
4462+ server : 'vless.example.com' ,
4463+ port : 443 ,
4464+ uuid : UUID ,
4465+ tls : true ,
4466+ 'name-cert-verify' : 'verify.example.com' ,
4467+ } ;
4468+
4469+ const supported = loadProducedJson ( 'sing-box' , proxy ) . outbounds [ 0 ] ;
4470+ const unsupported = loadProducedJson ( 'sing-box' , proxy , {
4471+ 'include-unsupported-proxy' : true ,
4472+ } ) . outbounds [ 0 ] ;
4473+
4474+ expect ( supported . tls ) . to . not . have . property ( 'certificate_server_name' ) ;
4475+ expect ( unsupported . tls . certificate_server_name ) . to . equal (
4476+ 'verify.example.com' ,
4477+ ) ;
4478+ } ) ;
4479+
44524480 it ( 'validates sing-box uTLS fingerprints for regular TLS and Reality outbounds' , function ( ) {
44534481 const output = loadProducedJson ( 'sing-box' , [
44544482 {
0 commit comments