@@ -1938,6 +1938,72 @@ let refresh_server_certificate =
19381938 ~params: [(Ref _host, " host" , " The host" )]
19391939 ~allowed_roles: _R_POOL_ADMIN ()
19401940
1941+ let list_trusted_certificates =
1942+ call ~flags: [`Session ] ~pool_internal: true ~hide_from_docs: true
1943+ ~name: " list_trusted_certificates"
1944+ ~doc:
1945+ " List the file names of all installed TLS trusted certificates on the \
1946+ host."
1947+ ~params:
1948+ [
1949+ (Ref _host, " host" , " The host." )
1950+ ; ( Bool
1951+ , " ca"
1952+ , " The trusted certificates are root CA certificates used to verify \
1953+ chains (true), or leaf certificates used for certificate pinning \
1954+ (false)."
1955+ )
1956+ ]
1957+ ~result:
1958+ ( Set String
1959+ , " All root CA certificates used to verify chains when ca = true, or all \
1960+ leaf certificates used for certificate pinning when ca = false."
1961+ )
1962+ ~allowed_roles: _R_LOCAL_ROOT_ONLY ~lifecycle: [] ()
1963+
1964+ let install_trusted_certificate =
1965+ call ~flags: [`Session ] ~pool_internal: true ~hide_from_docs: true
1966+ ~name: " install_trusted_certificate"
1967+ ~doc: " Install a TLS trusted certificate on this host."
1968+ ~params:
1969+ [
1970+ (Ref _host, " host" , " The host." )
1971+ ; ( Bool
1972+ , " ca"
1973+ , " The trusted certificate is a root CA certificate used to verify a \
1974+ chain (true), or a leaf certificate used for certificate pinning \
1975+ (false)."
1976+ )
1977+ ; (String , " name" , " The file name of the certificate." )
1978+ ; (String , " cert" , " The certificate in PEM format." )
1979+ ; ( Set Datamodel_certificate. certificate_purpose
1980+ , " purpose"
1981+ , " The purpose of the certificate."
1982+ )
1983+ ]
1984+ ~allowed_roles: _R_LOCAL_ROOT_ONLY ~lifecycle: [] ()
1985+
1986+ let uninstall_trusted_certificate =
1987+ call ~flags: [`Session ] ~pool_internal: true ~hide_from_docs: true
1988+ ~name: " uninstall_trusted_certificate"
1989+ ~doc: " Remove a TLS trusted certificate from this host."
1990+ ~params:
1991+ [
1992+ (Ref _host, " host" , " The host." )
1993+ ; ( Bool
1994+ , " ca"
1995+ , " The trusted certificate is a root CA certificate used to verify a \
1996+ chain (true), or a leaf certificate used for certificate pinning \
1997+ (false)"
1998+ )
1999+ ; (String , " name" , " The file name of the certificate." )
2000+ ; ( Bool
2001+ , " force"
2002+ , " If true, return success even if the file doesn't exist."
2003+ )
2004+ ]
2005+ ~allowed_roles: _R_LOCAL_ROOT_ONLY ~lifecycle: [] ()
2006+
19412007let display =
19422008 Enum
19432009 ( " host_display"
@@ -2897,6 +2963,9 @@ let t =
28972963 ; list_timezones
28982964 ; get_ntp_synchronized
28992965 ; set_servertime
2966+ ; list_trusted_certificates
2967+ ; install_trusted_certificate
2968+ ; uninstall_trusted_certificate
29002969 ]
29012970 ~contents:
29022971 ([
0 commit comments