2

Using the Objective-C gRPC library, how do I implement TLS certificate pinning?

Bonus question: how do I achieve this using GRPCcall2, and not the deprecated GRPCcall?

Phlippie Bosman
  • 5,378
  • 3
  • 26
  • 29

1 Answers1

2

gRPC doesn't support TLS certificate pinning, but you can set the root certificate in GRPCMutableCallOptions


/**
 * PEM format root certifications that is trusted. If set to nil, gRPC uses a list of default
 * root certificates.
 */
@property(copy, readwrite, nullable) NSString *PEMRootCertificates;

https://github.com/grpc/grpc/blob/master/src/objective-c/GRPCClient/GRPCCallOptions.h#L331

user3126412
  • 326
  • 1
  • 4