Skip to content

When connecting sliver-py to the server, it prompts:“Ssl handshake failed ” #1877

Closed
@eleveni386

Description

@eleveni386

OS: MacOS 15.2 (24C101) M4 Pro
Python version: 3.13.1
openssl version: OpenSSL 3.4.0 22 Oct 2024 (Library: OpenSSL 3.4.0 22 Oct 2024)
sliver-server version : 1.5.42

when sliver-py connect the server , it prompts:

grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:31337: Ssl handshake failed (TSI_PROTOCOL_FAILURE): SSL_ERROR_SSL: error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE: Invalid certificate verification context"
	debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:31337: Ssl handshake failed (TSI_PROTOCOL_FAILURE): SSL_ERROR_SSL: error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE: Invalid certificate verification context", grpc_status:14, created_time:"2025-02-02T14:42:12.194445+08:00"}"
>

the client code:

#!/usr/bin/env python3
import os
import sys
import asyncio
from sliver import SliverClientConfig, SliverClient

DEFAULT_CONFIG = sys.argv[1]

async def main():
    config = SliverClientConfig.parse_config_file(DEFAULT_CONFIG)
    print(config)
    client = SliverClient(config)
    print(client)
    print('[*] Connected to server ...')
    await client.connect()
    sessions = await client.sessions()
    print('[*] Sessions: %r' % sessions)
    if len(sessions):
        print('[*] Interacting with session %s', sessions[0].ID)
        interact = await client.interact_session(sessions[0].ID)
        ls = await interact.ls()
        print('[*] ls: %r' % ls)

if __name__ == '__main__':
    asyncio.run(main())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions