How to set DTLS protocol options in iOS? - ios

I am unable to figure out how to set the tls protocol version. This is part of the code I am using:
let tlsOptions = NWProtocolTLS.Options()
sec_protocol_options_add_pre_shared_key(...)
sec_protocol_options_add_tls_ciphersuite(tlsOptions.securityProtocolOptions, TLS_PSK_WITH_AES_128_GCM_SHA256)
sec_protocol_options_set_min_tls_protocol_version(tlsOptions.securityProtocolOptions, tls_protocol_version_t.DTLSv12)
let parameters = NWParameters(dtls: tlsOptions)
connection = NWConnection(host: ..., port: NWEndpoint.Port(rawValue: 2100)!, using: parameters)
connection.start(queue: .main)
When I run this code I get the following errors:
2019-10-19 14:30:31.628250+0200 MyApp[4906:117290] [BoringSSL] boringssl_helper_tls_protocol_version_from_SSLProtocol(111) [C6:1][0x7fd33fc4d4f0] Unknown SSLProtocol version: 11
2019-10-19 14:30:31.649137+0200 MyApp[4906:117290] [BoringSSL] boringssl_context_handle_fatal_alert(1874) [C6:1][0x7fd33fc4d4f0] read alert, level: fatal, description: bad record mac
2019-10-19 14:30:31.650008+0200 MyApp[4906:117290] [BoringSSL] boringssl_session_handshake_error_print(111) [C6:1][0x7fd33fc4d4f0] 140546626918936:error:100003fc:SSL routines:OPENSSL_internal:SSLV3_ALERT_BAD_RECORD_MAC:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl_Sim/boringssl-283.40.1/ssl/tls_record.cc:587:SSL alert number 20
2019-10-19 14:30:31.650105+0200 MyApp[4906:117290] [BoringSSL] nw_protocol_boringssl_handshake_negotiate_proceed(724) [C6:1][0x7fd33fc4d4f0] handshake failed at state 12288
It appears that the tls protocol version is unknown. This is the function I am using to set the version: https://developer.apple.com/documentation/security/3180218-sec_protocol_options_set_min_tls
I am using the tls_protocol_version_t.DTLSv12 contant so why does this show an error?

Related

Kubernetes - Unable to initialize control-plane

Can someone please help
I'm getting the following error when I run 'kubeadm init'
[init] Using Kubernetes version: v1.25.0
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.25.0: output: E0901 16:50:43.675142 4165 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-apiserver/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-apiserver:v1.25.0"
time="2022-09-01T16:50:43-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-apiserver:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-apiserver/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-controller-manager:v1.25.0: output: E0901 16:53:14.264007 4564 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-controller-manager/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-controller-manager:v1.25.0"
time="2022-09-01T16:53:14-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-controller-manager:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-controller-manager/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-scheduler:v1.25.0: output: E0901 16:55:44.364804 4922 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-scheduler/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-scheduler:v1.25.0"
time="2022-09-01T16:55:44-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-scheduler:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-scheduler/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-proxy:v1.25.0: output: E0901 16:58:14.769855 5295 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-proxy:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-proxy:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-proxy/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/kube-proxy:v1.25.0"
time="2022-09-01T16:58:14-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-proxy:v1.25.0\": failed to resolve reference \"registry.k8s.io/kube-proxy:v1.25.0\": failed to do request: Head https://registry.k8s.io/v2/kube-proxy/manifests/v1.25.0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[ERROR ImagePull]: failed to pull image registry.k8s.io/etcd:3.5.4-0: output: E0901 17:03:14.966455 6024 remote_image.go:218] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/etcd:3.5.4-0\": failed to resolve reference \"registry.k8s.io/etcd:3.5.4-0\": failed to do request: Head https://registry.k8s.io/v2/etcd/manifests/3.5.4-0: dial tcp 34.107.244.51:443: i/o timeout" image="registry.k8s.io/etcd:3.5.4-0"
time="2022-09-01T17:03:14-06:00" level=fatal msg="pulling image: rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/etcd:3.5.4-0\": failed to resolve reference \"registry.k8s.io/etcd:3.5.4-0\": failed to do request: Head https://registry.k8s.io/v2/etcd/manifests/3.5.4-0: dial tcp 34.107.244.51:443: i/o timeout"
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
I'm unable to initialize control-plane, made sure that docker is running.
kubectl, kubeadm is also working.
Does it look like issue on the K8 side, or did I do anything wrong.
As per output ,it does look like some connectivity issue due to following line , probably slow or no connectivity
failed to pull image registry.k8s.io******
can you check the connectivity to image registry with following
ping registry.k8s.io
You should get the response from server ,If you donot get the response back ,need to troubleshoot for network connectivity
PING registry.k8s.io(2600:1901:0:1013:: (2600:1901:0:1013::)) 56 data bytes
64 bytes from 2600:1901:0:1013:: (2600:1901:0:1013::): icmp_seq=1 ttl=56 time=69.1 ms
64 bytes from 2600:1901:0:1013:: (2600:1901:0:1013::): icmp_seq=2 ttl=56 time=83.9 ms
64 bytes from 2600:1901:0:1013:: (2600:1901:0:1013::): icmp_seq=3 ttl=56 time=83.4 ms
Look at the error message
[ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.25.0
The images are not getting pulled and hence the ImagePull error is thrown.
You should have internet connectivity from the machine where the initialize command was run.

Hyperledger Fabric V2.3 Snapshot: failed to create new connection: context deadline exceeded

I'm running Fabric v2.3 test network, and I'm trying to take a snapshot of the ledger.
When I run:
# peer snapshot submitrequest -c mychannel -b 0 --peerAddress peer0.org1.example.com:7051 --tlsRootCertFile /opt/gopath/src/github.com/hyperledger/fabric/peer/o
rganizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
I obtain:
Error: failed to retrieve snapshot client: snapshot client failed to connect to peer0.org1.example.com:7051: failed to create new connection: context deadline exceeded
The cli container can connect to peer1. Inspecting the orderer logs, it seems that a connection to 172.19.0.1 (on variable ports) is not successful: https://gist.github.com/RafaelAPB/962477f9bab5f34076add1a3b9f63588
Part of it:
2021-10-04 00:31:54.519 UTC [common.deliver] Handle -> WARN 066 Error reading from 172.19.0.8:53714: rpc error: code = Canceled desc = context canceled
By inspecting the logs of peer0.org1, it really seems that the problem is the connection with the orderer (in particular the TLS handshake): https://gist.github.com/RafaelAPB/6adf0c6e702387e4e0edd8de0dcf0a76
Part of it:
2021-10-04 00:52:03.595 UTC [comm.grpc.server] 1 -> INFO e6d unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.19.0.1:52374 grpc.code=OK grpc.call_duration=4.028085ms
2021-10-04 00:52:04.293 UTC [core.comm] ServerHandshake -> ERRO e6e Server TLS handshake failed in 33.508µs with error tls: first record does not look like a TLS handshake server=PeerServer remoteaddress=172.19.0.8:58532
2021-10-04 00:52:04.419 UTC [gossip.privdata] StoreBlock -> INFO e6f Received block [505] from buffer channel=mychannel
No configurations were added to the configtx.yaml regarding the snapshotting feature.
Any ideas on how to run the snapshot command successfully?

Nebula Graph fails on CentOS 6.5

Nebula Graph fails on CentOS 6.5, the error message is as follows:
# storage log
Heartbeat failed, status:RPC failure in MetaClient: N6apache6thrift9transport19TTransportExceptionE: AsyncSocketException: connect failed, type = Socket not open, errno = 111 (Connection refused): Connection refused
# meta log
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
E0415 22:32:38.944437 15532 AsyncServerSocket.cpp:762] failed to set SO_REUSEPORT on async server socket Protocol not available
E0415 22:32:38.945001 15510 ThriftServer.cpp:440] Got an exception while setting up the server: 92failed to bind to async server socket: [::]:0: Protocol not available
E0415 22:32:38.945057 15510 RaftexService.cpp:90] Setup the Raftex Service failed, error: 92failed to bind to async server socket: [::]:0: Protocol not available
E0415 22:32:38.949586 15463 NebulaStore.cpp:47] Start the raft service failed
E0415 22:32:38.949597 15463 MetaDaemon.cpp:88] Nebula store init failed
E0415 22:32:38.949796 15463 MetaDaemon.cpp:215] Init kv failed!
Nebula service status is as follows:
[root#redhat6 scripts]# ./nebula.service status all
[WARN] The maximum files allowed to open might be too few: 1024
[INFO] nebula-metad: Exited
[INFO] nebula-graphd: Exited
[INFO] nebula-storaged: Running as 15547, Listening on 44500
Reason for error: CentOS 6.5 system kernel version is 2.6.32, which is less than 3.9. However, SO_REUSEPORT only supports Linux 3.9 and above.
Upgrading the system to CentOS 7.5 can solve the problem by itself.

Call failed to connect: Connection error (503)

I am trying to use audio call in app, But when I call from a device to other device, It does not connect with device and automatically disconnected with twilio Api. What is that problem occurred in app?
2018-11-21 10:43:32.226794+0530 AppName[243:9466] StartCallAction transaction request successful
2018-11-21 10:43:32.279094+0530 AppName[243:7164] providerDidBegin
2018-11-21 10:43:32.279737+0530 AppName[243:7164] provider:performStartCallAction:
WARNING: no real random source present!
2018-11-21 10:43:32.308053+0530 AppName[243:7164] [INFO Twilio] recreateMainTransport, Found valid IPv4 address: IPAddress
2018-11-21 10:43:32.309170+0530 AppName[243:9465] [INFO TVOMakeCallCommand] Call URI: sip:None#chunderm.gll.twilio.com;transport=tls
2018-11-21 10:43:32.722550+0530 AppName[243:7164] provider:didActivateAudioSession:
2018-11-21 10:43:38.396482+0530 AppName[243:9514] TIC TCP Conn Failed [72:0x15ef5ca50]: 1:61 Err(61)
2018-11-21 10:43:38.397055+0530 AppName[243:9514] Task <7129FEF4-4EBE-4AC5-9B34-5E0D002AE56F>.<1> HTTP load failed (error code: -1004 [1:61])
2018-11-21 10:43:38.399459+0530 AppName[243:9466] Task <7129FEF4-4EBE-4AC5-9B34-5E0D002AE56F>.<1> finished with error - code: -1004
2018-11-21 10:43:38.808257+0530 AppName[243:7164] Call failed to connect: Connection error (503).

Docker option2, transport is closing error

I was trying the simple chain code, with membersvc and validation peer running in Docker for Mac. I got this error when running the chain code example 2:
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=localhost:30303 ./chaincode_example02
16:58:41.242 [shim] DEBU : Peer address: localhost:30303
16:58:41.244 [shim] DEBU : os.Args returns: [./chaincode_example02]
16:58:41.244 [shim] DEBU : Registering.. sending REGISTER
2016/08/22 16:58:41 transport: http2Client.notifyError got notified that the client transport was broken EOF.
16:58:41.245 [shim] ERRO : Received error from server: rpc error: code = 13 desc = "transport is closing", ending chaincode stream
Error starting Simple chaincode: rpc error: code = 13 desc = "transport is closing"
This issue is resolved with the latest docker build with the latest docker-compose file.

Resources