Relay not connecting client when using dtls as connection type but working fine with udp

There is no problem when trying to start the host with netcode for gameobject but the client doesn’t connect, neither does it show any error
This is how i am creating a relay

try
        {
            LobbyUI.Instance.HideLobbyCanvas();
            Allocation allocation =  await RelayService.Instance.CreateAllocationAsync(1);
            string joinCode= await RelayService.Instance.GetJoinCodeAsync(allocation.AllocationId);
            RelayServerData relayServerData = new RelayServerData(allocation,"dtls");
            NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(relayServerData);
            NetworkManager.Singleton.StartHost();
            return joinCode;
        }
        catch (RelayServiceException e) {
            LobbyUI.Instance.ShowLobbyCanvas();
            Debug.Log(e);
        }

and this is how i am joining a relay

try
        {
            Debug.Log(joinCode);
            LobbyUI.Instance.HideLobbyCanvas();
            JoinAllocation allocation= await RelayService.Instance.JoinAllocationAsync(joinCode);
            RelayServerData relayServerData = new RelayServerData(allocation, "udp");
            NetworkManager.Singleton.GetComponent<UnityTransport>().SetRelayServerData(relayServerData);
            NetworkManager.Singleton.StartClient();
        }
        catch (RelayServiceException e) {
            LobbyUI.Instance.ShowLobbyCanvas();
            Debug.Log(e);
        }

Are your host and client on the same machine?

If you wait a bit after starting the client, does it eventually show an error message? I think the default connection timeout is around a minute (you can change the values in the inspector under the ‘Unity Transport’ component).