Skip to content
Prev Previous commit
Next Next commit
print id result
  • Loading branch information
xiazhvera committed Jan 2, 2025
commit fac7640943e304c8180a351873e728cf64190328
6 changes: 4 additions & 2 deletions test/test_mqtt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from awscrt.auth import AwsCredentialsProvider
from awscrt.io import ClientBootstrap, DefaultHostResolver, EventLoopGroup
from awscrt.io import ClientBootstrap, DefaultHostResolver, EventLoopGroup, ClientTlsContext, TlsContextOptions
from awsiot import mqtt_connection_builder
import boto3
import botocore.exceptions
Expand Down Expand Up @@ -62,6 +62,7 @@ def get():
region = secrets.meta.region_name
response = secrets.get_secret_value(SecretId='ci/Cognito/identity_id')
cognito_id = response['SecretString']
print(cognito_id)

cognito = boto3.client('cognito-identity')
response = cognito.get_credentials_for_identity(IdentityId=cognito_id)
Expand Down Expand Up @@ -168,7 +169,8 @@ def test_websockets_cognito(self):
cognito_endpoint = f"cognito-identity.{config.region}.amazonaws.com"
credentials_provider = AwsCredentialsProvider.new_cognito(
endpoint=cognito_endpoint,
identity=config.cognito_id)
identity=config.cognito_id,
tls_ctx=ClientTlsContext(TlsContextOptions()))
connection = mqtt_connection_builder.websockets_with_default_aws_signing(
region=config.region,
credentials_provider=cred_provider,
Expand Down
Loading