mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	api/plugins: add tls-server-name arg for plugin registration (#23549)
* api/plugins: add tls-server-name arg for plugin registration * changelog
This commit is contained in:
		@@ -51,6 +51,7 @@ type PluginAPIClientMeta struct {
 | 
				
			|||||||
	flagCAPath     string
 | 
						flagCAPath     string
 | 
				
			||||||
	flagClientCert string
 | 
						flagClientCert string
 | 
				
			||||||
	flagClientKey  string
 | 
						flagClientKey  string
 | 
				
			||||||
 | 
						flagServerName string
 | 
				
			||||||
	flagInsecure   bool
 | 
						flagInsecure   bool
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -62,6 +63,7 @@ func (f *PluginAPIClientMeta) FlagSet() *flag.FlagSet {
 | 
				
			|||||||
	fs.StringVar(&f.flagCAPath, "ca-path", "", "")
 | 
						fs.StringVar(&f.flagCAPath, "ca-path", "", "")
 | 
				
			||||||
	fs.StringVar(&f.flagClientCert, "client-cert", "", "")
 | 
						fs.StringVar(&f.flagClientCert, "client-cert", "", "")
 | 
				
			||||||
	fs.StringVar(&f.flagClientKey, "client-key", "", "")
 | 
						fs.StringVar(&f.flagClientKey, "client-key", "", "")
 | 
				
			||||||
 | 
						fs.StringVar(&f.flagServerName, "tls-server-name", "", "")
 | 
				
			||||||
	fs.BoolVar(&f.flagInsecure, "tls-skip-verify", false, "")
 | 
						fs.BoolVar(&f.flagInsecure, "tls-skip-verify", false, "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return fs
 | 
						return fs
 | 
				
			||||||
@@ -70,13 +72,13 @@ func (f *PluginAPIClientMeta) FlagSet() *flag.FlagSet {
 | 
				
			|||||||
// GetTLSConfig will return a TLSConfig based off the values from the flags
 | 
					// GetTLSConfig will return a TLSConfig based off the values from the flags
 | 
				
			||||||
func (f *PluginAPIClientMeta) GetTLSConfig() *TLSConfig {
 | 
					func (f *PluginAPIClientMeta) GetTLSConfig() *TLSConfig {
 | 
				
			||||||
	// If we need custom TLS configuration, then set it
 | 
						// If we need custom TLS configuration, then set it
 | 
				
			||||||
	if f.flagCACert != "" || f.flagCAPath != "" || f.flagClientCert != "" || f.flagClientKey != "" || f.flagInsecure {
 | 
						if f.flagCACert != "" || f.flagCAPath != "" || f.flagClientCert != "" || f.flagClientKey != "" || f.flagInsecure || f.flagServerName != "" {
 | 
				
			||||||
		t := &TLSConfig{
 | 
							t := &TLSConfig{
 | 
				
			||||||
			CACert:        f.flagCACert,
 | 
								CACert:        f.flagCACert,
 | 
				
			||||||
			CAPath:        f.flagCAPath,
 | 
								CAPath:        f.flagCAPath,
 | 
				
			||||||
			ClientCert:    f.flagClientCert,
 | 
								ClientCert:    f.flagClientCert,
 | 
				
			||||||
			ClientKey:     f.flagClientKey,
 | 
								ClientKey:     f.flagClientKey,
 | 
				
			||||||
			TLSServerName: "",
 | 
								TLSServerName: f.flagServerName,
 | 
				
			||||||
			Insecure:      f.flagInsecure,
 | 
								Insecure:      f.flagInsecure,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								changelog/23549.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								changelog/23549.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
				
			|||||||
 | 
					```release-note:improvement
 | 
				
			||||||
 | 
					api/plugins: add `tls-server-name` arg for plugin registration
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
		Reference in New Issue
	
	Block a user