[英]Stripe no longer supports API requests made with TLS 1.0 in Xamarin Android?
我正在使用Xamarin Android。 我正在實現條紋以進行支付,但是當我按下Stripe API時,捕獲了以下異常
Stripe不再支持使用TLS 1.0發出的API請求。 請使用TLS 1.2或更高版本啟動HTTPS連接。
如何消除錯誤?
PS在Xamarin IOS中,相同的代碼可以正常工作。
這是我的代碼:
async Task<StripeCustomer> GetCustomer(string cId)
{
AppLog.WriteLogD(TAG, "Getting Customer...");
var customerService = new StripeCustomerService();
StripeCustomer stripeCustomer = null;
try
{
Task<StripeCustomer> getCustomerTask = customerService.GetAsync(cId);
stripeCustomer = await getCustomerTask;
//Console.WriteLine(stripeCustomer.StripeResponse.ResponseJson);
AppLog.WriteLogD(TAG, "Customer: " + stripeCustomer.Description, "(" + stripeCustomer.Email + ")");
}
catch (StripeException e)
{
AppLog.WriteLogD(TAG, "Error Type:" + e.StripeError.ErrorType);
AppLog.WriteLogD(TAG, "Message:: " + e.StripeError.Message);
}
return stripeCustomer;
}
根據Android文檔, API級別16或更高版本支持TLS 1.2
要激活它,您應該:
我可以通過以下方式解決此問題:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.