How to valicate https cerficate in ios?

Tom DING (EXT) 21 Reputation points
2021-04-02T03:08:52.977+00:00

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

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,296 questions
0 comments No comments
{count} votes

Accepted answer
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
    2021-04-02T08:00:39.427+00:00

    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://learn.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.


0 additional answers

Sort by: Most helpful