grpc / grpc/grpc

gRPC++ doesn't support ssl on iOS ?

Open
#28,296 11 comments 0 reactions 1 assignee Claimed by @sampajano View on GitHub
kind/bug platform/iOS priority/P2
Dominant language
C++
Stars
45.3k
Forks
11.4k
Avg merge
2d 12h
Merged PRs (30d)
47

Description

### What version of gRPC and what language are you using?
C++, gRPCv1.41.0

### What operating system (Linux, Windows,...) and version?
macOS Monterey 12.0.1

### What runtime / compiler are you using (e.g. python version or version of gcc)
-- Autoconf target triple: aarch64-apple-ios
-- Using minimum deployment version: 11.0 (SDK version: 15.0)
-- Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!
xcode 13.1
CMake version: 3.21.4
The C compiler is AppleClang 13.0.0.13000029
The C++ compiler is AppleClang 13.0.0.13000029
Autoconf target triple: aarch64-apple-ios
Using minimum deployment version: 11.0 (SDK version: 15.0)

### What did you do?
My cmake command as follows:

cmake -DCMAKE_INSTALL_PREFIX=../grpc-lib/arm64 \
-DPLATFORM=OS64 \
-DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake \
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_MAKE_PROGRAM=/usr/bin/make \
-DCARES_INSTALL=OFF \
-DCARES_STATIC=ON \
-DCARES_STATIC_PIC=ON \
-DCARES_BUILD_TESTS=OFF \
-DCARES_BUILD_TOOLS=OFF \
-DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_BUILD_CODEGEN=OFF \
-DgRPC_BUILD_TOOLS=OFF \
-DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_ABSL_PROVIDER=module \
-DgRPC_CARES_PROVIDER=module \
-DgRPC_PROTOBUF_PROVIDER=module \
-DgRPC_RE2_PROVIDER=module \
-DgRPC_SSL_PROVIDER=package \
-DOPENSSL_CRYPTO_LIBRARY=../openssl-arm64/lib/libcrypto.a \
-DLIB_EAY_LIBRARY_RELEASE=../openssl-arm64/lib/libcrypto.a \
-DOPENSSL_INCLUDE_DIR=../openssl-arm64/include \
-DSSL_EAY_LIBRARY_RELEASE=../openssl-arm64/lib/libssl.a \
-DOPENSSL_SSL_LIBRARY=../openssl-arm64/lib/libssl.a \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_PROTOC_BINARIES=OFF \
-Dprotobuf_BUILD_SHARED_LIBS=OFF \
-DENABLE_BITCODE=ON \
-DHAVE_LIBNSL=FALSE \
-DHAVE_SOCKET_LIBSOCKET=FALSE \
-DHAVE_GHBN_LIBSOCKET=FALSE \
-DHAVE_LIBSOCKET=FALSE \
-DHAVE_LIBRT=FALSE \
../grpc

the demo codes for client and server aren't listed, because they are tested ok on other platforms.

### What did you expect to see?
Successfully run as client and server on iOS platform.

### What did you see instead?
I‘m trying to use gRPC++ (compiled by myself) for iOS app, but it doesn't work out with ssl for server or client. but it was tested ok on other platforms.
when I start a grpc++ secure server on windows, and also I write the client code with secure channel on iOS, the console on windows print

"E1207 00:59:03.292000000 25020 ssl_transport_security.cc:1468] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER."

when I start a grpc++ secure server on iOS, but successfully run a insecure client on windows .

It appears that it created the insecure channel on iOS, but the secure server on windows reject the insecure request.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.