diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json b/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json index e18d6e163ce4..42ce64ba330f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/restapi.json @@ -9,5 +9,8 @@ }, "RESTAPI_TABLE_WITH_VALID_CONFIG": { "desc": "RESTAPI TABLE WITH VALID CONFIG." + }, + "RESTAPI_TABLE_WITH_MULTIPLE_CERTS": { + "desc": "RESTAPI TABLE WITH MULTIPLE CERTS." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json index 8ae212ed7026..f2a3b15643c6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/restapi.json @@ -34,5 +34,17 @@ } } } + }, + "RESTAPI_TABLE_WITH_MULTIPLE_CERTS": { + "sonic-restapi:sonic-restapi": { + "sonic-restapi:RESTAPI": { + "certs": { + "ca_crt": "/etc/sonic/credentials/ame_root.pem", + "server_crt": "/etc/sonic/credentials/restapiserver.crt", + "server_key": "/etc/sonic/credentials/restapiserver.key", + "client_crt_cname": "client.sonic.net,clientds.prod.net" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-restapi.yang b/src/sonic-yang-models/yang-models/sonic-restapi.yang index e049e2fa5c23..af509f2335d8 100644 --- a/src/sonic-yang-models/yang-models/sonic-restapi.yang +++ b/src/sonic-yang-models/yang-models/sonic-restapi.yang @@ -45,7 +45,7 @@ module sonic-restapi { leaf client_crt_cname { type string { - pattern '([a-zA-Z0-9_\-\.]+)'; + pattern '([a-zA-Z0-9_\-\.]+,)*([a-zA-Z0-9_\-\.]+)'; } description "Client cert name."; }