Skip to content

winrm-light 1/6: Framework-free WSMan core (templated envelopes, JDK HTTP, NTLM over HTTPS) #103

Description

@bertysentry

First step of replacing the CXF/JAX-WS stack with a minimal, dependency-free WSMan implementation (context: #102 trimmed the shaded jar to 10.6 MB, but ~9 MB of that is SOAP machinery WinRM barely uses).

Scope

  • New internal package org.metricshub.winrm.light — no public API change.
  • WSMan operations as templated XML envelopes (Create Shell / Command / Receive / Signal / Delete, Enumerate/Pull for WQL) — same approach as pywinrm and the Go client. No WSDL, no JAXB, no service model.
  • XML parsing with DocumentBuilderFactory.newDefaultInstance() / XMLInputFactory.newDefaultFactory() (JDK 9+): bypasses the ServiceLoader, making the client immune by construction to JAXP poisoning (e.g. Oracle xmlparserv2, Isolate extensions in dedicated classloaders to prevent cross-extension classpath pollution metricshub-community#1271).
  • HTTP via a small connection-affine client (NTLM authenticates the TCP connection, not the request — java.net.http.HttpClient does not guarantee reuse, so manage a keep-alive connection explicitly).
  • Auth: Basic + NTLMv2 over HTTPS (no message encryption needed under TLS). The repo already has pure-Java MD4; HMAC-MD5 and ARCFOUR come from the JDK.

Acceptance

  • WQL query + remote command execution against a real Windows host over HTTPS/NTLM and HTTP/Basic (unencrypted-allowed test config), driven by a standalone CLI harness.
  • Zero new runtime dependencies.

Follow-ups: NTLM message encryption over HTTP (2/6), Kerberos via JGSS (3/6), feature parity & fault mapping (4/6), differential test rig (5/6), backend switch & CXF removal (6/6).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions