Kamailio - WebSocket - Setup - kamailio

I am an web developer and want to create a WEBRTC application. My knowledge level in SIP is beginner. I want my application to talk to kamailio and in process of setting up kamailio by following the below articles.
http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket
http://kamailio.org/docs/modules/4.3.x/modules/websocket.html
I was able to connect (using try.jssp.net) to kamailio as multiple clients for initial setup but unable to call from one browser client to another client. Below is the log message that I see in the kamailio server.
I see this error message multiple times logged
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: INFO: <core> [parser/parse_fline.c:146]: parse_first_line(): ERROR:parse_first_line: method not followed by SP
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [parser/parse_fline.c:243]: parse_first_line(): parse_first_line: bad message (offset: 0)
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: DEBUG: <core> [parser/msg_parser.c:619]: parse_msg(): parse_msg: invalid message
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [parser/msg_parser.c:705]: parse_msg(): ERROR: parse_msg: message=<#001#020#002#021#037?#037?#012^cP#012^cP#001#020#002#026?A#037?H#0229w>
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [receive.c:149]: receive_msg(): core parsing of SIP message failed (10.94.99.80:8088/1)
and also found this in the log
DEBUG: <core> [dset.c:774]: uri_add_rcv_alias(): encoded <sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob> => [sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob;alias=172.18.57.119~60481~5]
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: nathelper [nathelper.c:965]: add_contact_alias_0_f(): contact uri host is not an ip address
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: ERROR: nathelper [nathelper.c:977]: add_contact_alias_0_f(): you can't call add_contact_alias twice, check your config!
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: ERROR: <script>: Error aliasing contact <<sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob>>
Additional log info
Aug 9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25072]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012REGISTER sip:ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK6572200#015#012Max-Forwards: 69#015#012To: <sip:agent01#ip-10-94-99-80.customdomain.com>#015#012From: "agent01" <sip:agent01#ip-10-94-99-80.customdomain.com>;tag=68gqn060sb#015#012Call-ID: 22oik6ujj2bfjuuauasgdq#015#012CSeq: 1 REGISTER#015#012Contact: <sip:d63im5st#avltu6trdhg0.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:74809558-6d30-42c3-afbd-072d5d0ad5ab>";expires=600#015#012Expires: 600#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: path,gruu,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 0#015#012#015#012
Aug 9 20:27:15 ip-10-94-99-80 /usr/sbin/kamailio[25073]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012REGISTER sip:ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS egvf3nqhdl35.invalid;branch=z9hG4bK4737687#015#012Max-Forwards: 69#015#012To: <sip:agent02#ip-10-94-99-80.customdomain.com>#015#012From: "agent02" <sip:agent02#ip-10-94-99-80.customdomain.com>;tag=8dldgic783#015#012Call-ID: v4rim0ku5dtqrtqkcgv0an#015#012CSeq: 1 REGISTER#015#012Contact: <sip:bh9ao5ab#egvf3nqhdl35.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:f593c0a4-0984-46a0-8f3e-a231fb4d1713>";expires=600#015#012Expires: 600#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: path,gruu,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 0#015#012#015#012
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012INVITE sip:agent02#ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK9231290#015#012Max-Forwards: 69#015#012To: <sip:agent02#ip-10-94-99-80.customdomain.com>#015#012From: "agent01" <sip:agent01#ip-10-94-99-80.customdomain.com>;tag=jngmrtvvec#015#012Call-ID: s1fdqticqc31ru6p5cfs#015#012CSeq: 9973 INVITE#015#012X-Can-Renegotiate: true#015#012Contact: <sip:d63im5st#avltu6trdhg0.invalid;transport=ws;ob>#015#012Content-Type: application/sdp#015#012Session-Expires: 90#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: timer,ice,replaces,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 3876#015#012#015#012v=0#015#012o=- 7098982196661734965 2 IN IP4 127.0.0.1#015#012s=-#015#012t=0 0#015#012a=group:BUNDLE audio video#015#012a=msid-semantic: WMS XynF2020ZZYtShWgfoYkS23q5sgbtcquUl0s#015#012m=audio 56249 RTP/SAVPF 111 103 104 9 0 8 106 105 13 126#015#012c=IN IP4 172.18.57.119#015#012a=rtcp:54672 IN IP4 172.18.57.119#015#012a=candidate:2390899093 1 udp 2122260223 172.18.57.119 56249 typ host generation 0#015#012a=candidate:1221703924 1 udp 2122194687 192.168.0.105 60197 typ host generation 0#015#012a=candidate:2390899093 2 udp 2122260222 172.18.57.119 54672 typ host generation 0#015#012a=candidate:1221703924 2 udp 2122194686 192.168.0.105 54423 typ host generation 0#015#012a=candidate:3221341541 1 tcp 1518280447 172.18.57.119 0 typ host tcptype active generation 0#015#012a=candidate:106054660 1 tcp 1518214911 192.168.0.105 0 typ host tcptype active generation 0#015#012a=candidate:3221341541 2 tcp 1518280446 172.18.57.119 0 typ host tcptype active generation 0#015#012a=candidate:106054660 2 tcp 1518214910 192.168.0.105 0 typ host tcptype active generation 0#015#012a=ice-ufrag:Las7oILW40BIM8zF#015#012a=ice-pwd:A3ewod5vG57HcA/JvnAaRGWV#015#012a=fingerprint:sha-256 31:22:C5:67:B6:CB:D0:66:7D:E4
Aug 9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012ACK sip:agent02#ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK9231290#015#012To: <sip:agent02#ip-10-94-99-80.customdomain.com>;tag=5f994d94abde79a17171e171202b0e42.d13e#015#012From: "agent01" <sip:agent01#ip-10-94-99-80.customdomain.com>;tag=jngmrtvvec#015#012Call-ID: s1fdqticqc31ru6p5cfs#015#012CSeq: 9973 ACK#015#012Content-Length: 0#015#012#015#012
Any help is appreciated

So you should check your kamailio.cfg, I think config is broken.
And maybe you want to use Asterisk or Freeswitch for WebRTC and PBX. You can find the Kamailio and Freeswitch integration tutorial here:
http://kb.asipto.com/freeswitch:kamailio-3.1.x-freeswitch-1.0.6d-sbc
It will be good choice using Kamailio as routing and registar server. Generally we use Freeswitch or Asterisk as media server for these kind of operations.
Please feel free ask me any questions.

Related

read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)

go t my server up and when loading client get this error. thank you for any help!
server config
port 1194
proto udp
dev tun
auth-nocache
ca "C:\Program Files\OpenVPN\easy-rsa\pki\ca.crt"
cert "C:\Program Files\OpenVPN\easy-rsa\pki\issued\server.crt"
key "C:\Program Files\OpenVPN\easy-rsa\pki\private\server.key"
dh "C:\Program Files\OpenVPN\easy-rsa\pki\dh.pem"
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
tls-auth "C:\Program Files\OpenVPN\easy-rsa\ta.key" 0 # This file is secret
cipher AES-256-CBC
data-ciphers AES-256-GCM:AES-128-GCM:AES-256-CBC
data-ciphers cipher AES-256-CBC
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1
client config
client
dev tun
;dev-node MyTap
;proto tcp
proto udp
remote 174.141.223.114 1194
;remote my-server-2 1194
;remote-random
resolv-retry infinite
nobind
;user nobody
;group nobody
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
remote-cert-tls server
cipher BF-CBC
comp-lzo
verb 3
;mute 20
log file on startup
MANAGEMENT: CMD 'signal SIGHUP'
2022-12-15 13:33:04 SIGHUP[hard,init_instance] received, process restarting
2022-12-15 13:33:04 MANAGEMENT: >STATE:1671129184,RECONNECTING,init_instance,,,,,
2022-12-15 13:33:04 WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
2022-12-15 13:33:04 DEPRECATED OPTION: --cipher set to 'BF-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). OpenVPN ignores --cipher for cipher negotiations.
2022-12-15 13:33:04 Note: '--allow-compression' is not set to 'no', disabling data channel offload.
2022-12-15 13:33:04 OpenVPN 2.6_beta1 [git:release/2.6/e778a6fd26d849dc] Windows-MSVC [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] [DCO] built on Dec 2 2022
2022-12-15 13:33:04 Windows version 6.1 (Windows 7), amd64 executable
2022-12-15 13:33:04 library versions: OpenSSL 3.0.7 1 Nov 2022, LZO 2.10
2022-12-15 13:33:04 Restart pause, 5 second(s)
2022-12-15 13:33:09 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
2022-12-15 13:33:09 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
2022-12-15 13:33:09 TCP/UDP: Preserving recently used remote address: [AF_INET]174.141.223.114:1194
2022-12-15 13:33:09 Socket Buffers: R=[8192->8192] S=[8192->8192]
2022-12-15 13:33:09 UDPv4 link local: (not bound)
2022-12-15 13:33:09 UDPv4 link remote: [AF_INET]174.141.223.114:1194
2022-12-15 13:33:09 MANAGEMENT: >STATE:1671129189,WAIT,,,,,,
2022-12-15 13:33:09 read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)
2022-12-15 13:33:11 read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)
2022-12-15 13:33:15 read UDPv4: Connection reset by peer (WSAECONNRESET) (fd=240,code=10054)
many thanks
followed the openvpn documentation, bit confusing

Armbian - Netlink operation failed: netlink support not available

i have a problem with usb modem & armbian on Rock64.
I have fresh image of Armbian 22.08 Jammy on my Rock64 hardware.
I plugged in DWM-222 (D-link usb gsm modem), installed usb-modeswitch & modem-manager
and i have created connection with modem-manager.
The connection was working successfully for one day, but then it lost connection.
I made a restart and it was up again for few minutes. Then got down.
Now i am unable to get it working at all.
I tried again total clean image with just the steps above, and it keeps reporting
netlink operation failed: netlink support not available
I couldn't find anything about this error on the internet.
Power supply is proper one (3A) and DWM-222 is working normally on my Ubuntu desktop PC.
This is full log:
Nov 16 20:17:45 rock64 NetworkManager[1630]: <warn> [1668626265.2333] modem-broadband[cdc-wdm0]: failed to connect modem: Couldn't reset interface before setting up data format: netlink operation failed: netlink support not available
Nov 16 20:17:45 rock64 NetworkManager[1630]: <info> [1668626265.2335] device (cdc-wdm0): state change: prepare -> failed (reason 'unknown', sys-iface-state: 'managed')
Nov 16 20:17:45 rock64 NetworkManager[1630]: <warn> [1668626265.2388] device (cdc-wdm0): Activation: failed for connection 'DLINK_modem'
Nov 16 20:17:45 rock64 NetworkManager[1630]: <info> [1668626265.2400] device (cdc-wdm0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Do you have any suggestions ?
Thank you

Instances can't get any IP from the DHCP server in OPENSTACK

I have openstack wallaby running in two vm in VBox with Ubuntu 20.04, Controller and compute1. Everything runs without issues in provider network flat type except the dhcp.
For example, I have a network created in the range of 192.168.8.20-192.168.8.30. I selected to have a DHCP.
The instance gets an ip and runs, but when running it I can't get a response from the DHCP, like it did not exist. I mean, the port is attached to the DCHP with the ip 192.168.8.20.
I can even connect to it running ip netns.
root#controller:/home/stack# ip netns list
qdhcp-36c8f4db-ccfc-483b-a5ff-868185dcce0f (id: 0)
When i try to ping the instance ip from the DHCP to the instance using netns the dhcp server did not get any response from the instance or any device in the network. The network works, because if I setup the ip manually in the instance I can get access to the gateway. But it didn't see the DHCP server, sending DHCP_DISCOVER without any response.
Address -> 192.168.8.0/24 36c8f4db-ccfc-483b-a5ff-868185dcce0f
Subnet -> 192.168.8.120,192.168.8.130 09c143c9-0225-4951-bd9c-61846b8078a1
DHCP -> 192.168.8.120 f4b2f7ba-c9e8-493d-a010-852e72f46ef7
Instance -> 192.168.8.22 53316673-b6eb-4880-866f-91b1613aa17c
The process:
root#controller:/home/stack# ps aux | grep dnsmasq
nobody 3616 0.0 0.0 12144 364 ? S 18:11 0:00 dnsmasq --no-hosts --no-resolv --pid-file=/var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/host --addn-hosts=/var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/opts --dhcp-leasefile=/var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/leases --dhcp-match=set:ipxe,175 --dhcp-userclass=set:ipxe6,iPXE --local-service --bind-dynamic --dhcp-range=set:subnet-09c143c9-0225-4951-bd9c-61846b8078a1,192.168.8.0,static,255.255.255.0,86400s --dhcp-option-force=option:mtu,1500 --dhcp-lease-max=256 --conf-file=/dev/null --domain=openstacklocal
root 6278 0.0 0.0 6380 2380 pts/1 S+ 18:59 0:00 grep --color=auto dnsmasq
And the log from /var/log/syslog
Nov 6 19:05:10 controller dnsmasq-dhcp[3616]: DHCPRELEASE(ns-f4b2f7ba-c9) 192.168.8.128 fa:16:3e:24:74:93
Nov 6 19:05:10 controller dnsmasq[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/addn_hosts - 1 addresses
Nov 6 19:05:10 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/host
Nov 6 19:05:10 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/opts
Nov 6 19:05:30 controller dnsmasq[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/addn_hosts - 2 addresses
Nov 6 19:05:30 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/host
Nov 6 19:05:30 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/opts
Nov 6 19:05:30 controller dnsmasq[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/addn_hosts - 2 addresses
Nov 6 19:05:30 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/host
Nov 6 19:05:30 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/opts
Nov 6 19:05:30 controller dnsmasq[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/addn_hosts - 2 addresses
Nov 6 19:05:30 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/host
Nov 6 19:05:30 controller dnsmasq-dhcp[3616]: read /var/lib/neutron/dhcp/36c8f4db-ccfc-483b-a5ff-868185dcce0f/opts

PostgreSQL SSH Tunnel Connection Within R (ssh_tunnel crashing when trying to connect)

I am trying to connect to a postgreSQL database (hosted on AWS RDS) via an SSH tunnel in R. So far, I have been able to connect using the following methods:
1.---------------------------
Opening the ssh tunnel in my terminal (MacOs) using
ssh -i {key file path} -f -N -L 5432:{db host}:5432 {ssh user}#{ssh host} -v
and then connecting to the database using
psql -hlocalhost -U{db user} -p5432 -dpostgres
2.---------------------------
Opening the ssh tunnel in my terminal and then running the following code in R to connect
conn <- dbConnect(
RPostgres::Postgres(),
dbname = db_name,
user = db_user,
password = db_password,
host = "127.0.0.1",
port = db_port
)
3.---------------------------
This is where the issue occurs. I'm able to connect by opening the ssh tunnel in R (in a background environment) with
tunnel_process <- callr::r_bg(
function(ssh_host, ssh_user, ssh_key, db_host, db_port) {
session <- ssh::ssh_connect(host = glue::glue("{ ssh_user }#{ ssh_host }"),
keyfile = ssh_key,
verbose = 3)
ssh::ssh_tunnel(session = session,
port = db_port,
target = glue::glue("{ db_host }:{ db_port }"))
},
args = list(ssh_host, ssh_user, ssh_key, db_host, db_port),
stdout = nullfile(),
stderr = nullfile()
)
But then I'm unable to use the same "dbConnect" code as above to connect. It only gives me the following error message
Error: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
I am however able to connect directly from the terminal using the connection code in part 1. but only if I run psql -hlocalhost -U{db user} -p5432 -dpostgres, then re-run the ssh tunnel code in R, and only THEN enter my password in the terminal. I would appear that every time I try to connect, it closes the SSH tunnel, so I then have to re-launch it before submitting my password.
Question---------------------------
From what I just detailed, it would appear that:
a. My database is reachable since I can easily connect through the terminal
b. My R code works since I'm able to use it to both successfully open the SSH tunnel AND connect to the database. I'm just unable to use both together for some reason.
c. The tunnel I open through R breaks any time I try to connect to the database. This is not the case for the tunnel I open directly in the terminal.
Since I want to be able to do everything directly from R, does anybody here have any ideas on what may be causing the issue?
EDIT---------------------------
Here's the log I get in R when I try to connect to the database, just before it closes the tunnel:
> ssh::ssh_tunnel(session = session,
+ port = db_port,
+ target = glue::glue("{ db_host }:{ db_port }"))
\ Waiting for connetion on port 5432... client connected!
channel_open: Creating a channel 43 with 64000 window and 32768 max packet
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=124,padding=18,comp=105,payload=105]
channel_open: Sent a SSH_MSG_CHANNEL_OPEN type direct-tcpip for channel 43
ssh_packet_socket_callback: packet: read type 80 [len=492,padding=16,comp=475,payload=475]
ssh_packet_process: Dispatching handler for packet type 80
ssh_packet_global_request: Received SSH_MSG_GLOBAL_REQUEST packet
ssh_packet_global_request: UNKNOWN SSH_MSG_GLOBAL_REQUEST hostkeys-00#openssh.com 0
ssh_packet_process: Couldn't do anything with packet type 80
packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
ssh_packet_socket_callback: packet: read type 91 [len=28,padding=10,comp=17,payload=17]
ssh_packet_process: Dispatching handler for packet type 91
ssh_packet_channel_open_conf: Received SSH2_MSG_CHANNEL_OPEN_CONFIRMATION
ssh_packet_channel_open_conf: Received a CHANNEL_OPEN_CONFIRMATION for channel 43:0
ssh_packet_channel_open_conf: Remote window : 2097152, maxpacket : 32768
| Tunneled -1 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=10,comp=17,payload=17]
channel_write_common: channel_write wrote 8 bytes
| Tunneled 7 bytes...ssh_packet_socket_callback: packet: read type 94 [len=28,padding=17,comp=10,payload=10]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 1 bytes data in 0 (local win=64000 remote win=2097144)
channel_default_bufferize: placing 1 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=63999 remote win=2097144)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=18,comp=9,payload=9]
grow_window: growing window (channel 43:0) to 1280000 bytes
ssh_channel_read_timeout: Read (1) buffered : 1 bytes. Window: 1280000
- Tunneled 8 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=316,padding=17,comp=298,payload=298]
channel_write_common: channel_write wrote 289 bytes
/ Tunneled 297 bytes...ssh_packet_socket_callback: packet: read type 94 [len=3964,padding=12,comp=3951,payload=3951]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 3942 bytes data in 0 (local win=1280000 remote win=2096855)
channel_default_bufferize: placing 3942 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276058 remote win=2096855)
ssh_channel_read_timeout: Read (3942) buffered : 3942 bytes. Window: 1276058
\ Tunneled 4239 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=156,padding=8,comp=147,payload=147]
channel_write_common: channel_write wrote 138 bytes
- Tunneled 4377 bytes...ssh_packet_socket_callback: packet: read type 94 [len=76,padding=15,comp=60,payload=60]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 51 bytes data in 0 (local win=1276058 remote win=2096717)
channel_default_bufferize: placing 51 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276007 remote win=2096717)
ssh_channel_read_timeout: Read (51) buffered : 51 bytes. Window: 1276007
| Tunneled 4428 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=140,padding=14,comp=125,payload=125]
channel_write_common: channel_write wrote 116 bytes
\ Tunneled 4544 bytes...ssh_packet_socket_callback: packet: read type 94 [len=60,padding=8,comp=51,payload=51]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 42 bytes data in 0 (local win=1276007 remote win=2096601)
channel_default_bufferize: placing 42 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1275965 remote win=2096601)
ssh_channel_read_timeout: Read (42) buffered : 42 bytes. Window: 1275965
/ Tunneled 4586 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=60,padding=19,comp=40,payload=40]
channel_write_common: channel_write wrote 31 bytes
- Tunneled 4617 bytes...packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_channel_send_eof: Sent a EOF on client channel (43:0)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_channel_close: Sent a close on client channel (43:0)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
tunnel closed!
For reference, this is what the same log looks like when using the workaround detailed in 3. (re-running the ssh_tunnel right before submitting my password in the terminal):
> ssh::ssh_tunnel(session = session,
+ port = db_port,
+ target = glue::glue("{ db_host }:{ db_port }"))
\ Waiting for connetion on port 5432... client connected!
channel_open: Creating a channel 43 with 64000 window and 32768 max packet
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=124,padding=18,comp=105,payload=105]
channel_open: Sent a SSH_MSG_CHANNEL_OPEN type direct-tcpip for channel 43
ssh_packet_socket_callback: packet: read type 80 [len=492,padding=16,comp=475,payload=475]
ssh_packet_process: Dispatching handler for packet type 80
ssh_packet_global_request: Received SSH_MSG_GLOBAL_REQUEST packet
ssh_packet_global_request: UNKNOWN SSH_MSG_GLOBAL_REQUEST hostkeys-00#openssh.com 0
ssh_packet_process: Couldn't do anything with packet type 80
packet_send2: packet: wrote [len=12,padding=6,comp=5,payload=5]
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
ssh_packet_socket_callback: packet: read type 91 [len=28,padding=10,comp=17,payload=17]
ssh_packet_process: Dispatching handler for packet type 91
ssh_packet_channel_open_conf: Received SSH2_MSG_CHANNEL_OPEN_CONFIRMATION
ssh_packet_channel_open_conf: Received a CHANNEL_OPEN_CONFIRMATION for channel 43:0
ssh_packet_channel_open_conf: Remote window : 2097152, maxpacket : 32768
| Tunneled -1 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=10,comp=17,payload=17]
channel_write_common: channel_write wrote 8 bytes
| Tunneled 7 bytes...ssh_packet_socket_callback: packet: read type 94 [len=28,padding=17,comp=10,payload=10]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 1 bytes data in 0 (local win=64000 remote win=2097144)
channel_default_bufferize: placing 1 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=63999 remote win=2097144)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=28,padding=18,comp=9,payload=9]
grow_window: growing window (channel 43:0) to 1280000 bytes
ssh_channel_read_timeout: Read (1) buffered : 1 bytes. Window: 1280000
- Tunneled 8 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=316,padding=17,comp=298,payload=298]
channel_write_common: channel_write wrote 289 bytes
\ Tunneled 297 bytes...ssh_packet_socket_callback: packet: read type 94 [len=3964,padding=12,comp=3951,payload=3951]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 3942 bytes data in 0 (local win=1280000 remote win=2096855)
channel_default_bufferize: placing 3942 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276058 remote win=2096855)
ssh_channel_read_timeout: Read (3942) buffered : 3942 bytes. Window: 1276058
/ Tunneled 4239 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=156,padding=8,comp=147,payload=147]
channel_write_common: channel_write wrote 138 bytes
| Tunneled 4377 bytes...ssh_packet_socket_callback: packet: read type 94 [len=76,padding=15,comp=60,payload=60]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 51 bytes data in 0 (local win=1276058 remote win=2096717)
channel_default_bufferize: placing 51 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1276007 remote win=2096717)
ssh_channel_read_timeout: Read (51) buffered : 51 bytes. Window: 1276007
- Tunneled 4428 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=140,padding=14,comp=125,payload=125]
channel_write_common: channel_write wrote 116 bytes
/ Tunneled 4544 bytes...ssh_packet_socket_callback: packet: read type 94 [len=60,padding=8,comp=51,payload=51]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 42 bytes data in 0 (local win=1276007 remote win=2096601)
channel_default_bufferize: placing 42 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1275965 remote win=2096601)
ssh_channel_read_timeout: Read (42) buffered : 42 bytes. Window: 1275965
\ Tunneled 4586 bytes...ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=92,padding=12,comp=79,payload=79]
channel_write_common: channel_write wrote 70 bytes
- Tunneled 4656 bytes...ssh_packet_socket_callback: packet: read type 94 [len=380,padding=15,comp=364,payload=364]
ssh_packet_process: Dispatching handler for packet type 94
channel_rcv_data: Channel receiving 355 bytes data in 0 (local win=1275965 remote win=2096531)
channel_default_bufferize: placing 355 bytes into channel buffer (stderr=0)
channel_rcv_data: Channel windows are now (local win=1275610 remote win=2096531)
ssh_channel_read_timeout: Read (355) buffered : 355 bytes. Window: 1275610
| Tunneled 5011 bytes...
Finally, here's the log when running ssh_connect:
> session <- ssh::ssh_connect(host = glue::glue("{ ssh_user }#{ ssh_host }"),
+ keyfile = ssh_key,
+ verbose = 3)
ssh_pki_import_privkey_base64: Trying to decode privkey passphrase=false
ssh_connect: libssh 0.8.6 (c) 2003-2018 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread
ssh_socket_connect: Nonblocking connection socket: 50
ssh_connect: Socket connecting, now waiting for the callbacks to work
ssh_connect: Actual timeout : 10000
ssh_socket_pollcallback: Received POLLOUT in connecting state
socket_callback_connected: Socket connection callback: 1 (0)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
callback_receive_banner: Received banner: SSH-2.0-OpenSSH_7.4
ssh_client_connection_callback: SSH server banner: SSH-2.0-OpenSSH_7.4
ssh_analyze_banner: Analyzing banner: SSH-2.0-OpenSSH_7.4
ssh_analyze_banner: We are talking to an OpenSSH client version: 7.4 (70400)
ssh_known_hosts_read_entries: Failed to open the known_hosts file '/etc/ssh/ssh_known_hosts': No such file or directory
ssh_client_select_hostkeys: Changing host key method to "ecdsa-sha2-nistp256,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ssh-rsa,ssh-dss"
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=644,padding=9,comp=634,payload=634]
ssh_packet_socket_callback: packet: read type 20 [len=1276,padding=10,comp=1265,payload=1265]
ssh_packet_process: Dispatching handler for packet type 20
ssh_kex_select_methods: Negotiated curve25519-sha256,ecdsa-sha2-nistp256,aes256-ctr,aes256-ctr,hmac-sha2-256,hmac-sha2-256,none,none,,
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=44,padding=6,comp=37,payload=37]
ssh_packet_socket_callback: packet: read type 31 [len=260,padding=11,comp=248,payload=248]
ssh_packet_process: Dispatching handler for packet type 31
ssh_packet_dh_reply: Received SSH_KEXDH_REPLY
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=12,padding=10,comp=1,payload=1]
ssh_client_curve25519_reply: SSH_MSG_NEWKEYS sent
ssh_packet_socket_callback: Processing 112 bytes left in socket buffer
ssh_packet_socket_callback: packet: read type 21 [len=12,padding=10,comp=1,payload=1]
ssh_packet_process: Dispatching handler for packet type 21
ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
crypt_set_algorithms2: Set output algorithm to aes256-ctr
crypt_set_algorithms2: Set HMAC output algorithm to hmac-sha2-256
crypt_set_algorithms2: Set input algorithm to aes256-ctr
crypt_set_algorithms2: Set HMAC input algorithm to hmac-sha2-256
ssh_packet_newkeys: Signature verified and valid
ssh_packet_socket_callback: Processing 96 bytes left in socket buffer
ssh_packet_socket_callback: packet: read type 7 [len=60,padding=6,comp=53,payload=53]
ssh_packet_process: Dispatching handler for packet type 7
ssh_packet_ext_info: Received SSH_MSG_EXT_INFO
ssh_packet_ext_info: Follows 1 extensions
ssh_packet_ext_info: Extension: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
ssh_connect: current state : 7
packet_send2: packet: wrote [len=28,padding=10,comp=17,payload=17]
ssh_service_request: Sent SSH_MSG_SERVICE_REQUEST (service ssh-userauth)
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
ssh_packet_socket_callback: packet: read type 6 [len=28,padding=10,comp=17,payload=17]
ssh_packet_process: Dispatching handler for packet type 6
ssh_packet_service_accept: Received SSH_MSG_SERVICE_ACCEPT
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=44,padding=4,comp=39,payload=39]
ssh_packet_socket_callback: packet: read type 51 [len=60,padding=15,comp=44,payload=44]
ssh_packet_process: Dispatching handler for packet type 51
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic
ssh_packet_userauth_failure: Access denied for 'none'. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic
ssh_key_algorithm_allowed: Checking rsa-sha2-512 with list <ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
ssh_key_algorithm_allowed: Checking rsa-sha2-512 with list <ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
ssh_key_algorithm_allowed: Checking rsa-sha2-512 with list <ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
ssh_socket_unbuffered_write: Enabling POLLOUT for socket
packet_send2: packet: wrote [len=636,padding=11,comp=624,payload=624]
ssh_packet_socket_callback: packet: read type 52 [len=12,padding=10,comp=1,payload=1]
ssh_packet_process: Dispatching handler for packet type 52
ssh_packet_userauth_success: Authentication successful

Chilkat HTTP with https

I'm currently using the Chilkat HTTP ActiveX control (version 9.3.2.0) with VB6... One of the servers where I download files from is switching over to https, but I can't get it to work... Using http it works perfectly, but when I change the URL to https it returns 0.
Here is the result of Http.LastErrorText:
ChilkatLog:
Download:
DllDate: Aug 5 2012
UnlockPrefix: **********
Username: BILL-DESKTOP:Bill
Architecture: Little Endian; 32-bit
Language: ActiveX
VerboseLogging: 0
backgroundThread: 0
url: https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f000&lev_10_m_above_ground=on&lev_2_m_above_ground=on&lev_entire_atmosphere=on&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&lev_mean_sea_level=on&lev_surface=on&var_APCP=on&var_PRMSL=on&var_TCDC=on&var_TMP=on&var_UGRD=on&var_VGRD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.2018120712
toLocalPath: C:\Progra~1\PCGrADS\gfs\grib\gfs_pgrbf_000.grib2
localFileAlreadyExists: 0
QuickGetToOutput_Download:
qGet_1:
simpleHttpRequest_3:
httpMethod: GET
requestUrl: https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl?file=gfs.t12z.pgrb2.0p25.f000&lev_10_m_above_ground=on&lev_2_m_above_ground=on&lev_entire_atmosphere=on&lev_entire_atmosphere_%5C%28considered_as_a_single_layer%5C%29=on&lev_mean_sea_level=on&lev_surface=on&var_APCP=on&var_PRMSL=on&var_TCDC=on&var_TMP=on&var_UGRD=on&var_VGRD=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.2018120712
Connecting to web server...
httpServer: nomads.ncep.noaa.gov
port: 443
Using HTTPS.
ConnectTimeoutMs_1: 10000
calling ConnectSocket2
IPV6 enabled connect with NO heartbeat.
connectingTo: nomads.ncep.noaa.gov
dnsCacheLookup: nomads.ncep.noaa.gov
Resolving domain name (IPV4)
GetHostByNameHB_ipv4: Elapsed time: 140 millisec
myIP_1: 192.168.1.38
myPort_1: 55564
connect successful (1)
clientHelloMajorMinorVersion: 3.1
buildClientHello:
majorVersion: 3
minorVersion: 1
numRandomBytes: 32
sessionIdSize: 0
numCipherSuites: 10
numCompressionMethods: 1
--buildClientHello
TlsAlert:
level: fatal
descrip: handshake failure
--TlsAlert
Closing connection in response to fatal error.
Failed to read incoming handshake messages. (1)
Client handshake failed. (3)
Failed to connect to HTTP server.
connectElapsedMs: 640
--simpleHttpRequest_3
--qGet_1
--QuickGetToOutput_Download
bFileDeleted: 1
totalElapsedMs: 672
ContentLength: 0
Failed.
--Download
--ChilkatLog
What am I doing wrong?
Regards,
Bill
You were using an old version from 2012, which did not yet implement TLS 1.2. Chilkat has since added support for TLS 1.2 (for many years now) and the latest version should work fine.

Resources