@@ -84,6 +84,10 @@ pub struct QuicInboundSettings {
8484 pub certificate : Option < String > ,
8585 #[ serde( rename = "certificateKey" , alias = "certificate_key" ) ]
8686 pub certificate_key : Option < String > ,
87+ #[ serde( rename = "rawCertificate" , alias = "raw_certificate" ) ]
88+ pub raw_certificate : Option < Vec < String > > ,
89+ #[ serde( rename = "rawCertificateKey" , alias = "raw_certificate_key" ) ]
90+ pub raw_certificate_key : Option < Vec < String > > ,
8791 pub alpn : Option < Vec < String > > ,
8892}
8993
@@ -92,6 +96,10 @@ pub struct TlsInboundSettings {
9296 pub certificate : Option < String > ,
9397 #[ serde( rename = "certificateKey" , alias = "certificate_key" ) ]
9498 pub certificate_key : Option < String > ,
99+ #[ serde( rename = "rawCertificate" , alias = "raw_certificate" ) ]
100+ pub raw_certificate : Option < Vec < String > > ,
101+ #[ serde( rename = "rawCertificateKey" , alias = "raw_certificate_key" ) ]
102+ pub raw_certificate_key : Option < Vec < String > > ,
95103}
96104
97105#[ derive( Serialize , Deserialize , Debug , Clone ) ]
@@ -205,6 +213,12 @@ pub struct TlsOutboundSettings {
205213 pub server_name : Option < String > ,
206214 pub alpn : Option < Vec < String > > ,
207215 pub certificate : Option < String > ,
216+ #[ serde( rename = "certificateKey" , alias = "certificate_key" ) ]
217+ pub certificate_key : Option < String > ,
218+ #[ serde( rename = "rawCertificate" , alias = "raw_certificate" ) ]
219+ pub raw_certificate : Option < Vec < String > > ,
220+ #[ serde( rename = "rawCertificateKey" , alias = "raw_certificate_key" ) ]
221+ pub raw_certificate_key : Option < Vec < String > > ,
208222 pub insecure : Option < bool > ,
209223}
210224
@@ -233,6 +247,12 @@ pub struct QuicOutboundSettings {
233247 #[ serde( rename = "serverName" , alias = "server_name" ) ]
234248 pub server_name : Option < String > ,
235249 pub certificate : Option < String > ,
250+ #[ serde( rename = "certificateKey" , alias = "certificate_key" ) ]
251+ pub certificate_key : Option < String > ,
252+ #[ serde( rename = "rawCertificate" , alias = "raw_certificate" ) ]
253+ pub raw_certificate : Option < Vec < String > > ,
254+ #[ serde( rename = "rawCertificateKey" , alias = "raw_certificate_key" ) ]
255+ pub raw_certificate_key : Option < Vec < String > > ,
236256 pub alpn : Option < Vec < String > > ,
237257}
238258
@@ -799,7 +819,9 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
799819 inbound. protocol = "quic" . to_string ( ) ;
800820 if let Some ( ext_settings) = ext_settings {
801821 let mut settings = internal:: QuicInboundSettings :: new ( ) ;
802- if let Some ( ext_certificate) = & ext_settings. certificate {
822+ if let Some ( ext_raw_certificate) = & ext_settings. raw_certificate {
823+ settings. certificate = ext_raw_certificate. join ( "\n " ) ;
824+ } else if let Some ( ext_certificate) = & ext_settings. certificate {
803825 if is_inline_certificate ( ext_certificate) {
804826 settings. certificate = ext_certificate. clone ( ) ;
805827 } else {
@@ -813,7 +835,9 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
813835 }
814836 }
815837 }
816- if let Some ( ext_certificate_key) = & ext_settings. certificate_key {
838+ if let Some ( ext_raw_certificate_key) = & ext_settings. raw_certificate_key {
839+ settings. certificate_key = ext_raw_certificate_key. join ( "\n " ) ;
840+ } else if let Some ( ext_certificate_key) = & ext_settings. certificate_key {
817841 let key = Path :: new ( & ext_certificate_key) ;
818842 if key. is_absolute ( ) {
819843 settings. certificate_key = key. to_string_lossy ( ) . to_string ( ) ;
@@ -839,7 +863,9 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
839863 inbound. protocol = "tls" . to_string ( ) ;
840864 if let Some ( ext_settings) = ext_settings {
841865 let mut settings = internal:: TlsInboundSettings :: new ( ) ;
842- if let Some ( ext_certificate) = & ext_settings. certificate {
866+ if let Some ( ext_raw_certificate) = & ext_settings. raw_certificate {
867+ settings. certificate = ext_raw_certificate. join ( "\n " ) ;
868+ } else if let Some ( ext_certificate) = & ext_settings. certificate {
843869 if is_inline_certificate ( ext_certificate) {
844870 settings. certificate = ext_certificate. clone ( ) ;
845871 } else {
@@ -853,7 +879,9 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
853879 }
854880 }
855881 }
856- if let Some ( ext_certificate_key) = & ext_settings. certificate_key {
882+ if let Some ( ext_raw_certificate_key) = & ext_settings. raw_certificate_key {
883+ settings. certificate_key = ext_raw_certificate_key. join ( "\n " ) ;
884+ } else if let Some ( ext_certificate_key) = & ext_settings. certificate_key {
857885 let key = Path :: new ( & ext_certificate_key) ;
858886 if key. is_absolute ( ) {
859887 settings. certificate_key = key. to_string_lossy ( ) . to_string ( ) ;
@@ -1098,7 +1126,9 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
10981126 if let Some ( ext_alpn) = & ext_settings. alpn {
10991127 settings. alpn = ext_alpn. clone ( ) ;
11001128 }
1101- if let Some ( ext_certificate) = & ext_settings. certificate {
1129+ if let Some ( ext_raw_certificate) = & ext_settings. raw_certificate {
1130+ settings. certificate = ext_raw_certificate. join ( "\n " ) ;
1131+ } else if let Some ( ext_certificate) = & ext_settings. certificate {
11021132 if is_inline_certificate ( ext_certificate) {
11031133 settings. certificate = ext_certificate. clone ( ) ;
11041134 } else {
@@ -1112,6 +1142,18 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
11121142 }
11131143 }
11141144 }
1145+ if let Some ( ext_raw_certificate_key) = & ext_settings. raw_certificate_key {
1146+ settings. certificate_key = ext_raw_certificate_key. join ( "\n " ) ;
1147+ } else if let Some ( ext_certificate_key) = & ext_settings. certificate_key {
1148+ let key = Path :: new ( & ext_certificate_key) ;
1149+ if key. is_absolute ( ) {
1150+ settings. certificate_key = key. to_string_lossy ( ) . to_string ( ) ;
1151+ } else {
1152+ let asset_loc = Path :: new ( & * crate :: option:: ASSET_LOCATION ) ;
1153+ let path = asset_loc. join ( key) . to_string_lossy ( ) . to_string ( ) ;
1154+ settings. certificate_key = path;
1155+ }
1156+ }
11151157 if let Some ( ext_insecure) = ext_settings. insecure {
11161158 settings. insecure = ext_insecure;
11171159 }
@@ -1260,7 +1302,9 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
12601302 if let Some ( ext_server_name) = & ext_settings. server_name {
12611303 settings. server_name = ext_server_name. clone ( ) ;
12621304 }
1263- if let Some ( ext_certificate) = & ext_settings. certificate {
1305+ if let Some ( ext_raw_certificate) = & ext_settings. raw_certificate {
1306+ settings. certificate = ext_raw_certificate. join ( "\n " ) ;
1307+ } else if let Some ( ext_certificate) = & ext_settings. certificate {
12641308 if is_inline_certificate ( ext_certificate) {
12651309 settings. certificate = ext_certificate. clone ( ) ;
12661310 } else {
@@ -1274,6 +1318,18 @@ pub fn to_internal(mut config: Config) -> Result<internal::Config> {
12741318 }
12751319 }
12761320 }
1321+ if let Some ( ext_raw_certificate_key) = & ext_settings. raw_certificate_key {
1322+ settings. certificate_key = ext_raw_certificate_key. join ( "\n " ) ;
1323+ } else if let Some ( ext_certificate_key) = & ext_settings. certificate_key {
1324+ let key = Path :: new ( & ext_certificate_key) ;
1325+ if key. is_absolute ( ) {
1326+ settings. certificate_key = key. to_string_lossy ( ) . to_string ( ) ;
1327+ } else {
1328+ let asset_loc = Path :: new ( & * crate :: option:: ASSET_LOCATION ) ;
1329+ let path = asset_loc. join ( key) . to_string_lossy ( ) . to_string ( ) ;
1330+ settings. certificate_key = path;
1331+ }
1332+ }
12771333 if let Some ( ext_alpns) = & ext_settings. alpn {
12781334 settings. alpn = ext_alpns. clone ( ) ;
12791335 }
0 commit comments