Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Jun 6, 2024
1 parent 95c09ff commit 8572d59
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lisa/sut_orchestrator/azure/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,15 @@ def _get_connection(self) -> Any:
self._log.debug("Creating connection to serial console")
connection_str = self._get_connection_string()

import ssl

ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE

# create websocket connection
self._ws = self._get_event_loop().run_until_complete(
websockets.connect(connection_str) # type: ignore
websockets.connect(connection_str, ssl=ssl_context) # type: ignore
)

return self._ws
Expand Down Expand Up @@ -2309,24 +2315,24 @@ def on_before_deployment(cls, *args: Any, **kwargs: Any) -> None:
settings = security_profile[0]
assert isinstance(settings, SecurityProfileSettings)
assert isinstance(settings.security_profile, SecurityProfileType)
node_parameters.security_profile[
"security_type"
] = cls._security_profile_mapping[settings.security_profile]
node_parameters.security_profile["security_type"] = (
cls._security_profile_mapping[settings.security_profile]
)
if settings.security_profile == SecurityProfileType.Stateless:
node_parameters.security_profile["secure_boot"] = False
node_parameters.security_profile[
"encryption_type"
] = "NonPersistedTPM"
node_parameters.security_profile["encryption_type"] = (
"NonPersistedTPM"
)
else:
node_parameters.security_profile["secure_boot"] = True
node_parameters.security_profile["encryption_type"] = (
"DiskWithVMGuestState"
if settings.encrypt_disk
else "VMGuestStateOnly"
)
node_parameters.security_profile[
"disk_encryption_set_id"
] = settings.disk_encryption_set_id
node_parameters.security_profile["disk_encryption_set_id"] = (
settings.disk_encryption_set_id
)

if node_parameters.security_profile["security_type"] == "":
node_parameters.security_profile.clear()
Expand Down

0 comments on commit 8572d59

Please sign in to comment.