{"id":20074265,"url":"https://github.com/juniper/netconf-java","last_synced_at":"2026-04-28T05:02:02.666Z","repository":{"id":845171,"uuid":"14484676","full_name":"Juniper/netconf-java","owner":"Juniper","description":"Java library for NETCONF","archived":false,"fork":false,"pushed_at":"2026-01-26T21:44:10.000Z","size":1093,"stargazers_count":88,"open_issues_count":19,"forks_count":66,"subscribers_count":30,"default_branch":"master","last_synced_at":"2026-03-14T11:17:08.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Juniper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-18T06:40:29.000Z","updated_at":"2026-03-11T07:14:35.000Z","dependencies_parsed_at":"2025-03-13T18:31:57.415Z","dependency_job_id":null,"html_url":"https://github.com/Juniper/netconf-java","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/Juniper/netconf-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fnetconf-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fnetconf-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fnetconf-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fnetconf-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Juniper","download_url":"https://codeload.github.com/Juniper/netconf-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Juniper%2Fnetconf-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30628405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T14:50:10.941Z","updated_at":"2026-04-28T05:02:02.658Z","avatar_url":"https://github.com/Juniper.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"netconf-java\n============\n\n**A modernized Java library for NETCONF (now Java 17‑compatible)**\n\nJava library for NETCONF\n\nSUPPORT\n=======\n\nThis software is not officially supported by Juniper Networks, but by a team dedicated to helping customers,\npartners, and the development community.  To report bug-fixes, issues, suggestions, please raise issues\nor even better submit pull requests on GitHub.\n\nREQUIREMENTS\n============\n\n* [OpenJDK 17](https://openjdk.org/projects/jdk/17/) or later\n* [Maven](https://maven.apache.org/download.cgi) if you want to build using `mvn` [Supported from v2.1.1].\n* [Gradle 8+](https://gradle.org/releases/) if you prefer a Gradle build (`./gradlew build`)\n\nBuilding\n========\nYou can build the project using **Maven** or **Gradle**.\n\n### Maven\n```bash\nmvn clean package\n```\n\n### Gradle\n```bash\n./gradlew clean build\n```\n(The wrapper script downloads the correct Gradle version automatically.)\n\nTo run the live NETCONF integration suite with Gradle:\n\n```bash\nNETCONF_HOST=192.168.1.1 \\\nNETCONF_USERNAME=admin \\\nNETCONF_PASSWORD=secret \\\nNETCONF_PORT=830 \\\n./gradlew integrationTest\n```\n\nReleases\n========\nReleases contain source code only. Due to changing JDK licensing, jar files are not released.\nUser may download the source code and compile it with desired JDK version.\n\n* Instructions to build\n  * Download Source Code for the required release\n  * Compile the code and build the jar using your chosen JDK version\n  * Use the jar file\n\n* Instructions to build using `mvn`\n  * Download Source Code for the required release\n  * Compile the code and build the jar using `mvn package`\n  * Use the jar file from `./target/`\n  * Use `mvn versions:display-dependency-updates` to identify possible target versions for dependencies\n  \n=======\n\nv2.2.1\n------\n* Hardened NETCONF XML parsing against XXE and DTD-based attacks\n* Fixed NETCONF RPC framing and `message-id` reply correlation for sequential session reuse\n* Enforced shared NETCONF base capability negotiation and derive session framing from the negotiated base version\n* Capability-gated candidate, validate, and confirmed-commit operations before sending RPCs\n* Added negotiated capability inspection via `Device.getNegotiatedCapabilities()` and `NetconfSession.getNegotiatedCapabilities()`\n* Typed NETCONF `\u003crpc-error\u003e` replies as structured exceptions so callers can inspect server-reported error details\n* Added `ValidateException` and clarified `validate()` semantics: server `rpc-error` replies throw, while warning-only or other non-`\u003cok/\u003e` non-error replies still return `false`\n* Improved SSH/NETCONF session cleanup on failed connection or session initialization\n* Fixed shell exec helpers so commands are set, channels are connected, and timeout/cleanup behavior is more predictable\n* Fixed nested XML path construction in the XML helper\n* Documented `NetconfSession` as a sequential request/response channel rather than a concurrent in-flight RPC transport\n* Added [`docs/compatibility.md`](docs/compatibility.md) with current RFC, capability, NMDA, and extension support details\n* Added a dedicated Gradle `integrationTest` task that forwards NETCONF connection settings for live-server testing\n* Upgraded `assertj-core` to `3.27.7` to address `CVE-2026-24400`\n\nv2.2.0\n------\n* Java 17 baseline; compiled with `--release 17`\n* Gradle build added alongside Maven\n* SpotBugs upgraded to 6.x\n* Added **:confirmed-commit:1.1** support (`commitConfirm(timeout, persist)` and `cancelCommit(persistId)`)\n* Added **killSession(String)** helper for RFC 6241 §7.9\n* Auto‑inject base 1.1 capability in \u0026lt;hello\u0026gt; exchange\n* Gradle wrapper committed; GitHub Actions now builds Maven *and* Gradle\n* Expanded Javadoc and SpotBugs clean‑up\n\nv2.1.1\n------\n\n* Fixed `mvn` build issues\n\nv2.0.0\n------\n\n* Replaced the ssh library with [JSch](http://www.jcraft.com/jsch/)\n  * Adds support for new ssh crypto algorithms\n  * More modern ssh implementation\n* Added support for importing and building the library with maven\n* Added FindBugs code testing to maven build\n\nThis is a breaking change to the API. New Device objects are now created using a builder.\nExample:\n\n```Java\nDevice device = Device.builder().hostName(\"hostname\")\n    .userName(\"username\")\n    .password(\"password\")\n    .connectionTimeout(2000)\n    .hostKeysFileName(\"hostKeysFileName\")\n    .build();\n```\n\nSYNOPSIS\n========\n\n```Java\nimport java.io.IOException;\nimport javax.xml.parsers.ParserConfigurationException;\nimport net.juniper.netconf.NetconfException;\nimport net.juniper.netconf.ValidateException;\nimport org.xml.sax.SAXException;\n\nimport net.juniper.netconf.XML;\nimport net.juniper.netconf.Device;\n\npublic class ShowInterfaces {\n    public static void main(String args[]) throws NetconfException,\n                ParserConfigurationException, SAXException, IOException {\n\n        try (Device device = Device.builder()\n                .hostName(\"hostname\")\n                .userName(\"username\")\n                .password(\"password\")\n                .hostKeysFileName(\"hostKeysFileName\")\n                .connectionTimeout(2000)\n                .commandTimeout(5000)\n                .build()) {\n\n            // Establish the SSH transport and the default NETCONF session.\n            device.connect();\n\n            // Send RPC and receive RPC reply as XML.\n            XML rpcReply = device.executeRPC(\"get-interface-information\");\n            /* OR\n             * device.executeRPC(\"\u003cget-interface-information/\u003e\");\n             * OR\n             * device.executeRPC(\"\u003crpc\u003e\u003cget-interface-information/\u003e\u003c/rpc\u003e\");\n             */\n\n            System.out.println(rpcReply);\n        }\n    }\n}\n```\n\nCandidate validate example:\n\n```Java\ntry {\n    boolean clean = device.validate();\n    if (!clean) {\n        // Warning-only or other non-error, non-\u003cok/\u003e reply.\n        System.out.println(\"Validate completed without rpc-error, but did not return \u003cok/\u003e\");\n    }\n} catch (ValidateException e) {\n    // Server returned one or more \u003crpc-error\u003e elements.\n    System.err.println(\"Validate failed: \" + e.getMessage());\n    e.getRpcErrors().forEach(System.err::println);\n}\n```\n\nRecommended usage:\n\n* Build one `Device` per target connection and use `try-with-resources` so SSH resources are released predictably.\n* Call `connect()` before issuing RPCs. If `connect()` throws, no usable NETCONF session was established.\n* Inspect `getNegotiatedCapabilities()` after `connect()` if your application needs to branch on server support for candidate, validate, or confirmed-commit behavior.\n* Set `connectionTimeout` and `commandTimeout` explicitly for production use rather than relying on defaults.\n* Prefer NETCONF RPC helpers (`executeRPC`, `getConfig`, `loadXMLConfiguration`, `commit`, and friends) for device operations; use shell helpers only for device-specific workflows that are not available over NETCONF.\n* Treat `ValidateException` as the server-side `rpc-error` path for `validate()`. A `false` return now means the reply was non-error but not a clean `\u003cok/\u003e`, typically warnings.\n* Shell helper reads are bounded by `commandTimeout`. If you use `runShellCommandRunning(...)`, always close the returned reader so the underlying exec channel is released.\n\nLICENSE\n=======\n\n(BSD 2)\n\nCopyright © 2013, Juniper Networks\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n(1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nThe views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Juniper Networks.\n\nAUTHOR\n======\n\n[Ankit Jain](http://www.linkedin.com/in/ankitj093), Juniper Networks\n[Peter J Hill](https://github.com/peterjhill), Oracle\n[Community Contributors](https://github.com/Juniper/netconf-java/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniper%2Fnetconf-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniper%2Fnetconf-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniper%2Fnetconf-java/lists"}