SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER

207 views
Skip to first unread message

Bogdan Moise

unread,
Mar 5, 2021, 7:34:50 AM3/5/21
to grpc.io
Hello,

I use an objective c client and the server is go, when I try to stream from the server to the client I encounter this problem, do you have any idea why? Thank you very much

Error: SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER
Proto: 
service Event {
rpc eventSubscription ( stream eventRequest) returns ( stream eventResponse) {}
rpc listFeatures(eventRequest) returns (stream eventResponse) {}
}

message eventRequest {
string id = 1;
}

message eventResponse {
string id = 1;
string key = 2;
string value = 3;
}

ObjC code:
#import <Foundation/Foundation.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import "GrpcService.h"
#import <GrpcService/Event.pbrpc.h>

static NSString * const hostAddress = @"localhost:50052";
RCT_EXPORT_METHOD(stream:(NSString *)name)
{
[GRPCCall useInsecureConnectionsForHost:hostAddress];
CPHWEvent *client = [[CPHWEvent alloc] initWithHost:hostAddress];
CPHWeventRequest *request = [CPHWeventRequest message];
GRPCUnaryResponseHandler *handler =
[[GRPCUnaryResponseHandler alloc] initWithResponseHandler:
^(CPHWeventResponse *response, NSError *error) {
if (response) {
NSLog(@"%@", response);
} else {

}
} responseDispatchQueue:nil];

GRPCUnaryProtoCall *call = [client listFeaturesWithMessage:request responseHandler:handler callOptions:nil];

[call start];
}

Go code:
func (s *Server) EventSubscription(stream pbEvent.Event_EventSubscriptionServer) error {
log.Println("Started stream")
var length int
length = len(global.TestStrings)
for {
TestStrings := global.TestStrings

if len(TestStrings) > length {
response := &pbEvent.EventResponse{
Id: TestStrings[length].Id,
Value: TestStrings[length].Value,
Key: TestStrings[length].Key,
}

if err := stream.Send(response); err != nil {
log.Println(err)
} else {
log.Println("send...")
//global.TestStrings = append(global.TestStrings[:0], global.TestStrings[1:]...)
length++
}
}
}


Reply all
Reply to author
Forward
0 new messages