Skip to content

IIOP通信以外でrtcname形式、rtcloc形式でRTCへアクセスできるようにする#1015

Merged
n-ando merged 8 commits into
OpenRTM:masterfrom
Nobu19800:featue/sslhttpconf
Apr 20, 2026
Merged

IIOP通信以外でrtcname形式、rtcloc形式でRTCへアクセスできるようにする#1015
n-ando merged 8 commits into
OpenRTM:masterfrom
Nobu19800:featue/sslhttpconf

Conversation

@Nobu19800

Copy link
Copy Markdown

Identify the Bug

rtcname形式(指定アドレスのネームサーバーからRTCを取得)、rtcloc形式(指定アドレスのマスターマネージャからRTCを取得)の機能を使う場合、IIOPの通信プロトコルのみ使用できるようになっており、SSLIOPやHTIOP等は使用できない。

Description of the Change

以下のようにrtcnamertclocの後に通信プロトコル名を指定することによりSSLIOP、HTIOP通信などの通信を使用可能にした。

rtcname.ssliop://localhost:2809/test.host_cxt/ConsoleOut0
rtcname.https://localhost:2809/call#test.host_cxt/ConsoleOut0
rtcloc.ssliop://localhost:2810/example/ConsoleOut0
rtcloc.http://localhost:2810/call#example/ConsoleOut0

この機能の実装のため、rtcname形式、rtcloc形式の文字列から通信プロトコル名、アドレス、RTC名を取得するCORBA_RTCUtil::RTCURIObjectを実装した。

Verification

  • Did you succeed the build?
  • No warnings for the build?
  • Have you passed the unit tests?

n-ando
n-ando previously approved these changes Jan 24, 2022
@n-kawauchi n-kawauchi marked this pull request as ready for review August 30, 2024 09:19

@n-kawauchi n-kawauchi 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.

最新masterへマージしたところコンフリクトしました。

>git merge featue/sslhttpconf
Auto-merging CMakeLists.txt
Auto-merging etc/CMakeLists.txt
Auto-merging src/lib/rtm/CORBA_RTCUtil.cpp
Auto-merging src/lib/rtm/CORBA_RTCUtil.h
Auto-merging src/lib/rtm/Manager.cpp
CONFLICT (content): Merge conflict in src/lib/rtm/Manager.cpp
Auto-merging src/lib/rtm/Manager.h
Auto-merging src/lib/rtm/ManagerServant.cpp
Auto-merging src/lib/rtm/NamingManager.cpp
CONFLICT (content): Merge conflict in src/lib/rtm/NamingManager.cpp
Auto-merging src/lib/rtm/PortBase.cpp
Auto-merging utils/openrtmNames/NamingContext.cpp
Automatic merge failed; fix conflicts and then commit the result.

@Nobu19800

Copy link
Copy Markdown
Author

動作確認の手順は以下の通り。

#1003 と同じ手順でhttpのネームサーバー、ConsoleInコンポーネントを起動する。

> bin\vc14\openrtmNames.exe -f ext/rtc.names.http.conf
> Components\C++\Examples\vc14\ConsoleInComp.exe -f ext/http/rtc.http.conf

ConsoleOutコンポーネントでmanager.components.preconnectオプションを設定して、データポートを接続して、画面にConnector Listener: ON_CONNECT~のメッセージが表示されていれば動作に問題なし。

以下はネームサーバーからRTCにアクセスする(rtcname)のコマンド。

> Components\C++\Examples\vc14\ConsoleOutComp.exe -f ext/http/rtc.http.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.http://localhost:2809/call#%COMPUTERNAME%.host_cxt/ConsoleIn0.out"
(中略)
------------------------------
Connector Listener: ON_CONNECT
Profile::name:      ConsoleOut0.in?port=rtcname.http://localhost:2809/call#DESKTOP-R549M7A.host_cxt/ConsoleIn0.out
Profile::id:        5ae1df37-8127-486d-8e49-46d34aa50595
Profile::properties:
- data_type: IDL:RTC/TimedLong:1.0
- allow_dup_connection:
- dataflow_type: push
- interface_type: corba_cdr
- serializer
  - cdr
    - endian: little,big
- inport:
- provider:

------------------------------

次にマスターマネージャからRTCにアクセスする(rtcloc)手順を試す。
まず、マスターマネージャを起動する。

> bin\vc14\rtcd2.exe -d -f ext/http/rtc.http.conf

次にConsoleInコンポーネントを起動するが、これはrtcnameの手順と同じ。

Components\C++\Examples\vc14\ConsoleInComp.exe -f ext/http/rtc.http.conf

ConsoleOutコンポーネントを起動してデータポートの接続を確認する。

Components\C++\Examples\vc14\ConsoleOutComp.exe -f ext/http/rtc.http.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcloc.http://localhost:2810/call#example/ConsoleIn0.out" -o "naming.type:manager"

これを#1003 と同様に、https、ws、wss、sslについても動作を確認する。

rtcname.https://localhost:2809/call#%COMPUTERNAME%.host_cxt/ConsoleIn0.out
rtcname.ws//localhost:2809/ws#%COMPUTERNAME%.host_cxt/ConsoleIn0.out
rtcname.wss://localhost:2809/ws#%COMPUTERNAME%.host_cxt/ConsoleIn0.out
rtcname.ssliop://localhost:2809/%COMPUTERNAME%.host_cxt/ConsoleIn0.out
rtcloc.https://localhost:2810/call#example/ConsoleIn0.out
rtcloc.ws//localhost:2810/ws#example/ConsoleIn0.out
rtcloc.wss://localhost:2810/ws#example/ConsoleIn0.out
rtcloc.ssliop://localhost:2810/example/ConsoleIn0.out

@n-kawauchi

n-kawauchi commented Dec 25, 2025

Copy link
Copy Markdown

最新masterへマージしてUbuntu24.04上で動作確認しましたが、ConsoleOut側がエラーになります。

$ git log --oneline
2c982034 (HEAD -> master) Merge branch 'featue/sslhttpconf'
90a2dbf7 (origin/master, origin/HEAD) Merge pull request #1218 from Nobu19800/bugs/defaultinscan
   :
  • ネームサーバを起動
$ sudo systemctl stop omniorb-nameserver.service
$ /usr/bin/openrtmNames -f /usr/etc/rtc.names.http.conf
  • ConsoleInを起動
$ mkdir test
$ cd test/
$ cp -r /usr/share/openrtm-2.1/components/c++/examples/* .
$ ./ConsoleInComp -f /usr/etc/http/rtc.http.conf
  • ConsoleOutを起動するとomniORBのエラーが表示されます。
$ ./ConsoleOutComp -f /usr/etc/http/rtc.http.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.http://localhost:2809/call#`hostname`.host_cxt/ConsoleIn0.out" 
omniORB: (0) 2026-04-08 14:06:43.186828: Error: the application attempted to invoke an operation on a nil reference.
succeed.
=================================================
 Component Profile
-------------------------------------------------
InstanceID:     ConsoleOut0
Implementation: ConsoleOut
 :
data_type: IDL:RTC/TimedLong:1.0
-------------------------------------------------
omniORB: (? 136914048894656) 2026-04-08 14:06:53.229756: Error: the application attempted to invoke an operation on a nil reference.
  • ConsoleOutのログを見るとERRORとして下記が出力されています。
Apr 08 05:06:43.187 ERROR: manager: rtcname.http://localhost:2809/call#thinkpad-6.host_cxt/ConsoleIn0 not found.

@Nobu19800

Copy link
Copy Markdown
Author

以下の修正を追加しました。

  • RtORB対応のための修正 #1204 の修正ミスによりOpenRTMNamesに不具合が発生していたため修正
  • omniORBの不具合かは不明だが、giop:tcpのエンドポイントがない場合に_is_equivalent関数が正常に動作しないため、confファイルでgiop:tcpのエンドポイント追加
  • CA の秘密鍵と証明書の問題で、証明書の検証なしのモード(sslVerifyMode = none)でないと動作しないため、CA の秘密鍵と証明書を再生成した

動作確認をお願いします。
@n-kawauchi

@n-kawauchi n-kawauchi 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.

動作確認は全てOKでした。確認詳細は以下の通りです。

  • httpのrtcname形式確認・・・OK
    • 端末1
      $ sudo systemctl stop omniorb-nameserver.service
      $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.http.conf
      
    • 端末2
      $ ./ConsoleInComp -f /usr/etc/http/rtc.http.conf
      
    • 端末3
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.http.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.http://localhost:2809/call#`hostname`.host_cxt/ConsoleIn0.out"
         :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcname.http://localhost:2809/call#thinkpad-6.host_cxt/ConsoleIn0.out
      
  • httpのrtcloc形式確認・・・OK
    • 端末1 : openrtmNamesプロセス起動中
    • 端末2
      $ rtcd2 -d -f /usr/etc/http/rtc.http.conf
      
    • 端末3
      $ ./ConsoleInComp -f /usr/etc/http/rtc.http.conf
      
    • 端末4
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.http.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcloc.http://localhost:2810/call#example/ConsoleIn0.out" -o "naming.type:manager"
        :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcloc.http://localhost:2810/call#example/ConsoleIn0.out
      
      
  • httpsのrtcname形式確認・・・OK
    • 端末1
      $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.https.conf
      
    • 端末2
      $ ./ConsoleInComp -f /usr/etc/http/rtc.https.conf
      
    • 端末3
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.https.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.https://localhost:2809/call#`hostname`.host_cxt/ConsoleIn0.out"
         :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcname.https://localhost:2809/call#thinkpad-6.host_cxt/ConsoleIn0.out
      
  • httpsのrtcloc形式確認・・・OK
    • 端末1 : openrtmNamesプロセス起動中
    • 端末2
      $ rtcd2 -d -f /usr/etc/http/rtc.https.conf
      
    • 端末3
      $ ./ConsoleInComp -f /usr/etc/http/rtc.https.conf
      
    • 端末4
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.https.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcloc.https://localhost:2810/call#example/ConsoleIn0.out" -o "naming.type:manager"
        :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcloc.https://localhost:2810/call#example/ConsoleIn0.out
      
      
  • wsのrtcname形式確認・・・OK
    • 端末1
      $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.ws.conf
      
    • 端末2
      $ ./ConsoleInComp -f /usr/etc/http/rtc.ws.conf
      
    • 端末3
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.ws.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.ws://localhost:2809/ws#`hostname`.host_cxt/ConsoleIn0.out"
         :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcname.ws://localhost:2809/ws#thinkpad-6.host_cxt/ConsoleIn0.out
      
  • wsのrtcloc形式確認・・・OK
    • 端末1 : openrtmNamesプロセス起動中
    • 端末2
      $ rtcd2 -d -f /usr/etc/http/rtc.ws.conf
      
    • 端末3
      $ ./ConsoleInComp -f /usr/etc/http/rtc.ws.conf
      
    • 端末4
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.ws.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcloc.ws://localhost:2810/ws#example/ConsoleIn0.out" -o "naming.type:manager"
        :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcloc.ws://localhost:2810/ws#example/ConsoleIn0.out
      
      
  • wssのrtcname形式確認・・・OK
    • 端末1
      $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.wss.conf
      
    • 端末2
      $ ./ConsoleInComp -f /usr/etc/http/rtc.wss.conf
      
    • 端末3
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.wss.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.wss://localhost:2809/ws#`hostname`.host_cxt/ConsoleIn0.out"
         :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcname.wss://localhost:2809/ws#thinkpad-6.host_cxt/ConsoleIn0.out
      
  • wssのrtcloc形式確認・・・OK
    • 端末1 : openrtmNamesプロセス起動中
    • 端末2
      $ rtcd2 -d -f /usr/etc/http/rtc.wss.conf
      
    • 端末3
      $ ./ConsoleInComp -f /usr/etc/http/rtc.wss.conf
      
    • 端末4
      $ ./ConsoleOutComp -f /usr/etc/http/rtc.wss.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcloc.wss://localhost:2810/ws#example/ConsoleIn0.out" -o "naming.type:manager"
        :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcloc.wss://localhost:2810/ws#example/ConsoleIn0.out
      
      
  • ssliopのrtcname形式確認・・・OK
    • 端末1
      $ /usr/bin/openrtmNames -f /usr/etc/rtc.names.ssl.conf
      
    • 端末2
      $ ./ConsoleInComp -f /usr/etc/ssl/rtc.ssl.conf
      
    • 端末3
      $ ./ConsoleOutComp -f /usr/etc/ssl/rtc.ssl.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcname.ssliop://localhost:2809/`hostname`.host_cxt/ConsoleIn0.out"
         :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcname.ssliop://localhost:2809/thinkpad-6.host_cxt/ConsoleIn0.out
      
  • ssliopのrtcloc形式確認・・・OK
    • 端末1 : openrtmNamesプロセス起動中
    • 端末2
      $ rtcd2 -d -f /usr/etc/ssl/rtc.ssl.conf
      
    • 端末3
      $ ./ConsoleInComp -f /usr/etc/ssl/rtc.ssl.conf
      
    • 端末4
      $ ./ConsoleOutComp -f /usr/etc/ssl/rtc.ssl.conf -o "manager.components.preconnect:ConsoleOut0.in?port=rtcloc.ssliop://localhost:2810/example/ConsoleIn0.out" -o "naming.type:manager"
        :
      Connector Listener: ON_CONNECT
      Profile::name:      ConsoleOut0.in?port=rtcloc.ssliop://localhost:2810/example/ConsoleIn0.out
      
      

@n-ando n-ando merged commit b0f8893 into OpenRTM:master Apr 20, 2026
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants