[GH-ISSUE #618] [Bug]: Unable to connect to Virtual printer #397

Closed
opened 2026-05-06 12:29:04 +02:00 by BreizhHardware · 6 comments

Originally created by @dlawler489 on GitHub (Mar 5, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/618

Originally assigned to: @maziggy on GitHub.

Bug Description

Hi, great work!

I'm having an issue getting either Bambu Studio v 2.5.0.66 on Mac (tried it on Windows as well, but can't remember the version - it was downloaded and installed today.
I also repeated the test in Orca Slicer with the same error.

Connect (Serial Number here) failed![Serial number], code=-1

I have copied the cert content into my printers file, and checked with mosquitto from my Mac to ensure the MQTT connection to the virtual printer was working (it did). I can control the physical printer fine (tried it with both A1 and P2S.

I am using the 1 IP for both the server itself, and the virtual printer, I only have 1 printer connected it to (I tried on different networks, at work and at home.

Expected Behavior

The slicer to be able to connect to the virtual printer

Steps to Reproduce

as per bug discription

Printer Model

A1

Bambuddy Version

v0.2.2b1

Printer Firmware Version

1.07.02

Installation Method

Other

Operating System

Linux (Ubuntu/Debian)

Relevant Logs / Support Package


Screenshots

No response

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this bug hasn't already been reported
  • I am using the latest version of Bambuddy
  • My printer is set to LAN Only mode
  • My printer has Developer Mode enabled
Originally created by @dlawler489 on GitHub (Mar 5, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/618 Originally assigned to: @maziggy on GitHub. ### Bug Description Hi, great work! I'm having an issue getting either Bambu Studio v 2.5.0.66 on Mac (tried it on Windows as well, but can't remember the version - it was downloaded and installed today. I also repeated the test in Orca Slicer with the same error. Connect (Serial Number here) failed![Serial number], code=-1 I have copied the cert content into my printers file, and checked with mosquitto from my Mac to ensure the MQTT connection to the virtual printer was working (it did). I can control the physical printer fine (tried it with both A1 and P2S. I am using the 1 IP for both the server itself, and the virtual printer, I only have 1 printer connected it to (I tried on different networks, at work and at home. ### Expected Behavior The slicer to be able to connect to the virtual printer ### Steps to Reproduce as per bug discription ### Printer Model A1 ### Bambuddy Version v0.2.2b1 ### Printer Firmware Version 1.07.02 ### Installation Method Other ### Operating System Linux (Ubuntu/Debian) ### Relevant Logs / Support Package ```shell ``` ### Screenshots _No response_ ### Additional Context _No response_ ### Checklist - [x] I have searched existing issues to ensure this bug hasn't already been reported - [x] I am using the latest version of Bambuddy - [x] My printer is set to LAN Only mode - [x] My printer has Developer Mode enabled
Author
Owner

@maziggy commented on GitHub (Mar 5, 2026):

Need a suppprt package -> https://wiki.bambuddy.cool/features/system-info/?h=debug#enable-debug-logging

<!-- gh-comment-id:4003048755 --> @maziggy commented on GitHub (Mar 5, 2026): Need a suppprt package -> https://wiki.bambuddy.cool/features/system-info/?h=debug#enable-debug-logging
Author
Owner

@dlawler489 commented on GitHub (Mar 5, 2026):

bambuddy-support-20260305-175940.zip

Sorry, attached it now.

<!-- gh-comment-id:4003093807 --> @dlawler489 commented on GitHub (Mar 5, 2026): [bambuddy-support-20260305-175940.zip](https://github.com/user-attachments/files/25761304/bambuddy-support-20260305-175940.zip) Sorry, attached it now.
Author
Owner

@maziggy commented on GitHub (Mar 5, 2026):

Please use latest beta branch 0.2.2b2 and try again.

<!-- gh-comment-id:4003225776 --> @maziggy commented on GitHub (Mar 5, 2026): Please use latest beta branch 0.2.2b2 and try again.
Author
Owner

@begna112 commented on GitHub (Mar 5, 2026):

I ran into the same code=-1 issue connecting OrcaSlicer to the virtual printer proxying an X1C (firmware 01.11.02.00). Built 0.2.2b2 from source and the issue persisted.

Root cause: The Bind-TLS proxy (port 3002) was failing with SSL error connecting to <printer>:3002: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE]. The printer only supports plain RSA key exchange cipher suites (e.g. AES256-GCM-SHA384), but Python's OpenSSL 3.5 defaults exclude those in favor of forward-secrecy ciphers (ECDHE/DHE only). So the TLS handshake fails because client and server have no ciphers in common.

Confirmed by testing with openssl s_client from the same host — it connects fine because it offers a wider cipher set including plain RSA. Python's ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) does not.

Fix: In backend/app/services/virtual_printer/tcp_proxy.py, add the RSA ciphers back to the client SSL context:

def _create_client_ssl_context(self) -> ssl.SSLContext:
    """Create SSL context for connecting to printer."""
    ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
    ctx.check_hostname = False
    ctx.verify_mode = ssl.CERT_NONE
    ctx.minimum_version = ssl.TLSVersion.TLSv1_2
    # Bambu printers use plain RSA key exchange (no ECDHE/DHE),
    # which modern OpenSSL defaults exclude. Add them back.
    ctx.set_ciphers("DEFAULT:AES256-GCM-SHA384:AES128-GCM-SHA256")
    return ctx

After rebuilding with this change, the Bind-TLS proxy connects successfully and OrcaSlicer can reach the virtual printer. Tested on X1C — not sure if the same cipher limitation applies to all Bambu printer models (A1, P1S, etc.) or even all production X1Cs, but it seems likely given the shared firmware TLS stack.

<!-- gh-comment-id:4003418814 --> @begna112 commented on GitHub (Mar 5, 2026): I ran into the same `code=-1` issue connecting OrcaSlicer to the virtual printer proxying an X1C (firmware 01.11.02.00). Built 0.2.2b2 from source and the issue persisted. **Root cause:** The Bind-TLS proxy (port 3002) was failing with `SSL error connecting to <printer>:3002: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE]`. The printer only supports plain RSA key exchange cipher suites (e.g. `AES256-GCM-SHA384`), but Python's OpenSSL 3.5 defaults exclude those in favor of forward-secrecy ciphers (ECDHE/DHE only). So the TLS handshake fails because client and server have no ciphers in common. Confirmed by testing with `openssl s_client` from the same host — it connects fine because it offers a wider cipher set including plain RSA. Python's `ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)` does not. **Fix:** In `backend/app/services/virtual_printer/tcp_proxy.py`, add the RSA ciphers back to the client SSL context: ```python def _create_client_ssl_context(self) -> ssl.SSLContext: """Create SSL context for connecting to printer.""" ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE ctx.minimum_version = ssl.TLSVersion.TLSv1_2 # Bambu printers use plain RSA key exchange (no ECDHE/DHE), # which modern OpenSSL defaults exclude. Add them back. ctx.set_ciphers("DEFAULT:AES256-GCM-SHA384:AES128-GCM-SHA256") return ctx ``` After rebuilding with this change, the Bind-TLS proxy connects successfully and OrcaSlicer can reach the virtual printer. Tested on X1C — not sure if the same cipher limitation applies to all Bambu printer models (A1, P1S, etc.) or even all production X1Cs, but it seems likely given the shared firmware TLS stack.
Author
Owner

@maziggy commented on GitHub (Mar 5, 2026):

@begna112 please let's continue in https://github.com/maziggy/bambuddy/issues/620

<!-- gh-comment-id:4003445725 --> @maziggy commented on GitHub (Mar 5, 2026): @begna112 please let's continue in https://github.com/maziggy/bambuddy/issues/620
Author
Owner

@chris-krammer commented on GitHub (Mar 8, 2026):

Hi, just a note when building OrcaSlicer locally.
You need to add the Cert from BamBuddy BEFORE you build the OrcaSlicer-AppImage.

  1. Extract the OrcaSlicer files
  2. add BamBuddy cert to /path/to/extracted/OrcaSlicer-x.y.z/resources/cert/printer.cert
  3. build with ./build_linux.sh -dsti
  4. add BamBuddy virtual printer

Tested just yesterday with all the latest downloads

<!-- gh-comment-id:4018496442 --> @chris-krammer commented on GitHub (Mar 8, 2026): Hi, just a note when building OrcaSlicer locally. You need to add the Cert from BamBuddy BEFORE you build the OrcaSlicer-AppImage. 1. Extract the OrcaSlicer files 2. add BamBuddy cert to `/path/to/extracted/OrcaSlicer-x.y.z/resources/cert/printer.cert` 3. build with `./build_linux.sh -dsti` 4. add BamBuddy virtual printer Tested just yesterday with all the latest downloads
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#397
No description provided.