question

TomDINGEXT-6013 avatar image
0 Votes"
TomDINGEXT-6013 asked ·

How to valicate https cerficate in ios?

When I use NSUrlSession to send a request in Xamarin.Ios. Now I happen a ploblem when I valicate https cerficate.
When i valicate in native code, i use code like this:
83904-image.png



But when in Xamarin.Ios, the methods are all private, and the return value type is System.IntPtr , so i can't valicate the service cer with my local cer.
Dose have any method to resolve it? many thanks

dotnet-ios
image.png (52.2 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ColeXia-MSFT avatar image
0 Votes"
ColeXia-MSFT answered ·

Hello,

Welcome to Microsoft Q&A!

Xamarin.iOS does not expose the API for this part , We suggest you implement the function in native code(swift), and create it into binding library , and then reference the dll and use in Xamarin.iOS project .


For creating a swift binding library please check https://docs.microsoft.com/en-us/xamarin/ios/platform/binding-swift/walkthrough .


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thank u, I have try it, and i works.

0 Votes 0 ·