Skip to content

Commit 45e09ba

Browse files
docs: improve secure connection communication (#2423)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent fac9486 commit 45e09ba

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve secure connection communication

doc/source/getting_started/existing/index.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,21 @@ From Python, establish a connection to the existing client session by creating a
2222
2323
from ansys.geometry.core import Modeler
2424
25-
modeler = Modeler(host="localhost", port=50051)
25+
modeler = Modeler(host="localhost", port=50051, transport_mode="wnua") # On Windows
26+
# or
27+
modeler = Modeler(host="localhost", port=50051, transport_mode="uds") # On Linux
28+
# or
29+
modeler = Modeler(host="localhost", port=50051, transport_mode="insecure") # For any OS using insecure gRPC
2630
2731
If no error messages are received, your connection is established successfully.
2832
Note that your local port number might differ from the one shown in the preceding code.
2933

34+
.. note::
35+
36+
Starting from PyAnsys Geometry 0.14, the ``transport_mode`` parameter is required.
37+
For detailed information about available transport modes, secure connections, and
38+
compatibility with different Ansys releases, see :ref:`user_guide_connection_securing`.
39+
3040
Verify the connection
3141
---------------------
3242
If you want to verify that the connection is successful, request the status of the client

doc/source/getting_started/local/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ their API documentation:
7070
* `launch_modeler_with_spaceclaim <../../api/ansys/geometry/core/connection/launcher/index.html#launcher.launch_modeler_with_spaceclaim>`_
7171
* `launch_modeler_with_geometry_service <../../api/ansys/geometry/core/connection/launcher/index.html#launcher.launch_modeler_with_geometry_service>`_
7272

73+
.. note::
74+
75+
For information about transport modes and secure connections, see the
76+
:ref:`user_guide_connection_securing` section in the User Guide.
77+
7378
.. note::
7479

7580
Because this is the first release of the Geometry service, you cannot yet define a product version

doc/source/user_guide/connection.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,27 @@ To connect to a Modeler instance, you can use the :class:`Modeler() <ansys.geom
1818
which provides methods to connect to the desired CAD service. You can specify the connection parameters such
1919
as the host, port, and authentication details.
2020

21+
2122
.. code:: python
2223
2324
from ansys.geometry.core import Modeler
2425
2526
# Connect to a local Modeler instance
26-
modeler = Modeler(host="localhost", port=12345)
27+
modeler = Modeler(host="localhost", port=12345, transport_mode=...)
28+
29+
The ``transport_mode`` parameter can take several values depending on the type of connection you
30+
want to establish. You can refer to the `Securing connections`_ section for more details on the
31+
available transport modes.
32+
33+
.. warning:: Required ``transport_mode`` parameter
34+
35+
Starting from PyAnsys Geometry 0.14, the ``transport_mode`` parameter is required when using
36+
the ``Modeler()`` class. Only if the ``channel`` parameter is provided explicitly, the
37+
``transport_mode`` can be omitted.
38+
39+
However, if you are using the :func:`launch_modeler() <ansys.geometry.core.connection.launcher>`
40+
function to launch a local Modeler instance, the ``transport_mode`` parameter is optional and
41+
defaults to the appropriate mode based on the operating system and environment.
2742

2843
Connection types
2944
----------------
@@ -37,13 +52,24 @@ differ in the environment in which the transport takes place:
3752
Modeler client connects to it over the network. This is useful for accessing
3853
Modeler instances hosted on remote servers or cloud environments.
3954

55+
.. _user_guide_connection_securing:
56+
4057
Securing connections
4158
--------------------
4259

4360
When connecting to a remote Modeler instance, it is important to ensure that the connection
4461
is secure, not only to protect sensitive data but also to comply with organizational
4562
security policies. These secure connections can be established using various methods, such as:
4663

64+
.. warning:: Secure connection compatibility
65+
66+
Secure connections (mTLS, UDS, WNUA) are only available starting from Ansys release 24R2.
67+
However, some releases may require specific Service Packs to enable secure connection support.
68+
Starting from Ansys release 26R1, secure connections are available out-of-the-box without
69+
requiring additional Service Packs.
70+
71+
If you are using an Ansys release prior to 24R2, you must use insecure connections.
72+
4773
- **mTLS**: Mutual Transport Layer Security (mTLS) is a security protocol that ensures both the client
4874
and server authenticate each other using digital certificates. This provides a high level of
4975
security for the connection. PyAnsys Geometry supports mTLS connections to Modeler instances. In that

src/ansys/geometry/core/connection/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ def wait_until_healthy(
174174
raise ValueError(
175175
"Transport mode must be specified."
176176
" Use 'transport_mode' parameter with one of the possible options."
177-
" Options are: 'insecure', 'uds', 'wnua', 'mtls'."
177+
" Options are: 'insecure', 'uds', 'wnua', 'mtls'. See the following"
178+
" documentation for more details:"
179+
" https://geometry.docs.pyansys.com/version/stable/user_guide/connection.html#securing-connections"
178180
)
179181
else:
180182
from ansys.tools.common.cyberchannel import verify_transport_mode

0 commit comments

Comments
 (0)