title: How can I send https request with .p12 certificate on Objective-C or Swift
body: <p>I have a react-native project and I have to create Native module for https request with .p12 certification but I never use Objective-C (it's a little complicated) or Swift
  I found a class for https request with certification <a href="https://raw.githubusercontent.com/xdumaine/ios-secure-request/master/secure-request.m" rel="nofollow noreferrer">it is</a> but I didn't use this cause I don't have a .h file and my project folder;</p>
  
  <p><strong>MyBridge.h</strong></p>
  
  <pre><code>#import "React/RCTBridgeModule.h"
  
  @interface MyFirstBridge : NSObject &lt;RCTBridgeModule&gt;
  
  @end
  </code></pre>
  
  <p><strong>MyBridge.m</strong></p>
  
  <pre><code>#import "MyFirstBridge.h"
  #import &lt;React/RCTLog.h&gt;
  
  @implementation MyFirstBridge
  
  RCT_EXPORT_MODULE();
  
  RCT_EXPORT_METHOD(sendGetRequest:(NSString *)urllocation:(NSString *)location)
  {
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
  [request setHTTPMethod:@"GET"];
  [request setURL:[NSURL URLWithString:url]];
  
  NSError *error = nil;
  NSHTTPURLResponse *responseCode = nil;
  
  NSData *oResponseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;responseCode error:&amp;error];
  
   if([responseCode statusCode] != 200){
      NSLog(@"Error getting %@, HTTP status code %i", url, [responseCode statusCode]);
      return nil;
  }
  
    callback(@[[NSNull null], [[NSString alloc] initWithData:oResponseData encoding:NSUTF8StringEncoding]]);
  }
  
  @end
  </code></pre>
  
  <p>It works as basic <code>HTTP</code> get request but when I tried https service I need to pin a certificate for each request. How can I send a <code>HTTPS</code> request for this case?</p>