Skip to content

Add a migration guide from winrm4j to the site documentation - #163

Merged
bertysentry merged 2 commits into
mainfrom
feature/migrating-from-winrm4j
Aug 11, 2026
Merged

Add a migration guide from winrm4j to the site documentation#163
bertysentry merged 2 commits into
mainfrom
feature/migrating-from-winrm4j

Conversation

@bertysentry

Copy link
Copy Markdown
Contributor

Closes #159.

Adds src/site/markdown/migrating-from-winrm4j.md to the site documentation, targeting winrm4j users (the project is dormant: last release 0.12.3 in August 2021, last commit March 2023):

  • Why migrate — zero runtime dependencies vs the ~10 MB CXF stack, Java 11+ with no JAXB/JAX-WS additions, immunity to JAXP ServiceLoader conflicts, active maintenance, and the features winrm4j never had (WQL, file transfers, stdin, streaming, the CLI).
  • A five-minute side-by-sideWinRmTool vs WinRMClient for the same command.
  • One-for-one option mapping tablesWinRmTool.Builder / WinRmClientBuilder options to WinRMClient.builder(...), executeCommand/executePs (+ Writer variants) to command(...)/powerShell(...) with onStdout/onStderr/start(), and WinRmToolResponse to CommandResult. The winrm4j method names and defaults were verified against the winrm4j master sources (including its hardcoded WINRS_CODEPAGE=437, the default of 1 connection retry, and the PayloadEncryptionMode default).
  • Behavioral differences — always-on NTLM payload encryption over HTTP, no Basic auth, Kerberos requires HTTPS, UTF-8 (65001) vs code page 437, wall-clock timeout semantics, opt-in at-most-once retries (Optional retry policy for transient connection failures #158), one reused shell per client.

The page is linked from the Reference menu in site.xml, the overview's "Where to go next" list, and the installation page. mvn verify site passes; all cross-page anchors were checked against the rendered HTML.

🤖 Generated with Claude Code

New src/site/markdown/migrating-from-winrm4j.md: why migrate, a
one-for-one mapping of WinRmTool.Builder / WinRmClientBuilder options
and execution calls to the fluent WinRMClient API, the behavioral
differences worth knowing (always-on HTTP payload encryption, no Basic
auth, Kerberos requires HTTPS, UTF-8 vs code page 437, timeout and
retry semantics, shell reuse), and the features winrm4j never had.
Linked from the Reference menu, the overview, and the installation
page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26d4cac366

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +64 to +65
* The password is a **`char[]`**, not a `String`, so the caller can wipe the single authoritative
copy of the secret after closing the client.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the promise of a single wipeable password copy

When callers rely on wiping the supplied char[] after closing the client, this statement gives a false security guarantee: LightWinRMService.resolveAuthScheme() creates an immutable String with new String(winRMEndpoint.getPassword()) (LightWinRMService.java:264), and the NTLM/Kerberos authentication objects retain that string. Wiping the original array therefore does not erase the client's other password copy, so the guide should not describe it as the single authoritative copy unless the implementation is changed.

Useful? React with 👍 / 👎.

| `authenticationScheme(AuthSchemes.BASIC)` | none — use NTLM; see [behavioral differences](#behavioral-differences) |
| `disableCertificateChecks(true)` | `trustAllCertificates()` |
| `sslContext(SSLContext)` | `sslContext(SSLContext)` — hostname verification stays on |
| `hostnameVerifier(...)`, `sslSocketFactory(...)` | none — covered by `sslContext(...)` / `trustAllCertificates()`; see [TLS / HTTPS](tls.html) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Disclose that custom hostname verification has no secure equivalent

When a winrm4j deployment uses a custom HostnameVerifier to accept an alias while retaining certificate-chain validation, neither suggested replacement covers that behavior: sslContext(...) explicitly keeps hostname verification enabled, while trustAllCertificates() disables both hostname and certificate validation. Calling these options “covered” can either leave the migrated client unable to connect or push users toward an insecure trust-all configuration; document that the certificate must identify the requested hostname or that there is no selective verifier equivalent.

Useful? React with 👍 / 👎.

Comment on lines +137 to +139
* **No Basic authentication.** Basic sends credentials effectively in the clear and is disabled on
Windows by default; the client does not implement it. Use NTLM — every account that
authenticates with Basic also authenticates with NTLM, with no host-side change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require Negotiate when replacing Basic with NTLM

When migrating a host configured for Basic authentication with WinRM's Negotiate authentication disabled, switching to NTLM does require a host-side change: this client sends NTLM under Negotiate, and preparing-the-host.md identifies enabled Negotiate as a requirement. Accounts are not automatically usable through NTLM merely because Basic accepted them, particularly where policy disables NTLM, so the guide should tell users to enable Negotiate and confirm that NTLM is permitted rather than promise no configuration change.

Useful? React with 👍 / 👎.

…159)

Drop the "single wipeable password copy" promise (the client keeps an
internal String copy), state that hostname verification has no
custom-verifier hook rather than being "covered", and require Negotiate
enabled / NTLM permitted on the host when replacing Basic
authentication instead of promising no host-side change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bertysentry

Copy link
Copy Markdown
Contributor Author

@codex please review again

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: d0bcd972b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bertysentry
bertysentry merged commit 25063e8 into main Aug 11, 2026
5 checks passed
@bertysentry
bertysentry deleted the feature/migrating-from-winrm4j branch August 11, 2026 15:14
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

Successfully merging this pull request may close these issues.

Site documentation: migration guide from winrm4j

1 participant