Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eleveni386 opened this issue Feb 2, 2025 · 0 comments

Comments

@eleveni386
Copy link

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())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant