as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
useServerChallengeReceived is a custom hook that handles mTLS (Mutual TLS) authentication in Vega apps. This hook manages certificate challenges from servers and provides methods to set client certificates for secure communication. The following shows how to import the hook.
The following shows how to to use the hook.

AuthCertParams

If you need to provide authentication certificates as part of your server challenge, use the AuthCertParams interface to define them.

Properties

  • url - The URL for which to set the certificates
  • clientCert - Path to the client certificate file
  • clientKey - Path to the client key file

Hook interface definition

The following shows the hook’s return type definition.

Configuration: required assets

Network security configuration

To provide rootCA certificates, create a network-config.json file in your project’s assets/raw directory with the following structure.
Note: Replace "127.0.0.1" with your target domain and adjust includeSubdomains as needed. Setting includeSubdomains to true applies the certificate configuration to the main domain and all its subdomains (For example, both example.com and api.example.com). Set it to false to restrict the configuration to only the exact domain specified.

Certificate Files

Place the following certificate files in your application’s assets/raw directory.
The following sample shows a basic mTLS Implementation.

最后修改于 2026年10月26日