Sophie

Sophie

distrib > Fedora > 17 > i386 > by-pkgid > 675c8c8167236dfcf8d66da674f931e8 > files > 338

erlang-doc-R15B-03.3.fc17.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css">
<title>Erlang -- Using the File Transfer Service</title>
</head>
<body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container">
<script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript">
            <!--
              function getWinHeight() {
                var myHeight = 0;
                if( typeof( window.innerHeight ) == 'number' ) {
                  //Non-IE
                  myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth ||
                                                         document.documentElement.clientHeight ) ) {
                  //IE 6+ in 'standards compliant mode'
                  myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                  //IE 4 compatible
                  myHeight = document.body.clientHeight;
                }
                return myHeight;
              }

              function setscrollpos() {
                var objf=document.getElementById('loadscrollpos');
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
              }

              function addEvent(obj, evType, fn){
                if (obj.addEventListener){
                obj.addEventListener(evType, fn, true);
                return true;
              } else if (obj.attachEvent){
                var r = obj.attachEvent("on"+evType, fn);
                return r;
              } else {
                return false;
              }
             }

             addEvent(window, 'load', setscrollpos);

             //--></script><div id="leftnav"><div class="innertube">
<img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/cosFileTransfer-1.1.13.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>cosFileTransfer</strong><br><strong>User's Guide</strong><br><small>Version 1.1.13</small></p>
<br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p>
<ul class="flipMenu" imagepath="../../../../doc/js/flipmenu">
<li id="no" title="The cosFileTransfer Application" expanded="false">The cosFileTransfer Application<ul>
<li><a href="ch_contents.html">
              Top of chapter
            </a></li>
<li title="Content Overview"><a href="ch_contents.html#id59850">Content Overview</a></li>
<li title="Brief description of the User's Guide"><a href="ch_contents.html#id57519">Brief description of the User's Guide</a></li>
</ul>
</li>
<li id="no" title="Introduction to cosFileTransfer" expanded="false">Introduction to cosFileTransfer<ul>
<li><a href="ch_introduction.html">
              Top of chapter
            </a></li>
<li title="Overview"><a href="ch_introduction.html#id61147">Overview</a></li>
</ul>
</li>
<li id="no" title="Installing cosFileTransfer" expanded="false">Installing cosFileTransfer<ul>
<li><a href="ch_install.html">
              Top of chapter
            </a></li>
<li title="Installation Process "><a href="ch_install.html#id57197">Installation Process </a></li>
</ul>
</li>
<li id="loadscrollpos" title="Using the File Transfer Service" expanded="true">Using the File Transfer Service<ul>
<li><a href="ch_system.html">
              Top of chapter
            </a></li>
<li title="Overview"><a href="ch_system.html#id61189">Overview</a></li>
</ul>
</li>
<li id="no" title="cosFileTransfer Examples" expanded="false">cosFileTransfer Examples<ul>
<li><a href="ch_example.html">
              Top of chapter
            </a></li>
<li title="A tutorial on how to create a simple service"><a href="ch_example.html#id61854">A tutorial on how to create a simple service</a></li>
</ul>
</li>
</ul>
</div></div>
<div id="content">
<div class="innertube">
<h1>4 Using the File Transfer Service</h1>
  

  <h3><a name="id61189">4.1 
        Overview</a></h3>
    
    <p>This chapter describes how two File Transfer Service applications interact.</p>

    <h4>Components</h4>
      
      <p>There are several ways the OMG File Transfer Service can be used. 
        Below one scenario is visualized: </p>
      <a name="CosFileTransfer"></a>
      <img alt="IMAGE MISSING" src="CosFileTransfer.gif"><br>
        <em>Figure
        4.1:
         
        Figure 1: The File Transfer Service Components.</em>
      
      <ul>
        <li>
<strong>Source ORB:</strong> this is the ORB we want to transfer a file from/via and it holds 
         an object reference to a 
        <span class="bold_code"><a href="CosFileTransfer_VirtualFileSystem.html">Virtual File System (VFS)</a></span> which, 
         in this example, represents an FTP server.</li>
        <li>
<strong>Target ORB:</strong> the goal may be, for example, to transfer a new file or append to an 
         existing file placed at the location that this ORB's <span class="code">VFS</span> represents.
         In this scenario it is the local disk or the NFS.</li>
        <li>
<strong>Transport Protocol:</strong> initially the ORB's, i.e., target and source, communicate via
         normal <span class="code">CORBA</span> requests to determine whether or not they can communicate. If the 
         File Transfer Service's have one, or more, <span class="code">Transport Protocol</span> in common the data
         will be streamed using this protocol. The cosFileTransfer application currently supports 
        <span class="code">TCP/IP</span> and <span class="code">SSL</span>.</li>
      </ul>
      <p>Which type of file system the <span class="code">VFS</span> is supposed to represent is determined
        by the options given when creating it, which is also how one determine which 
        <span class="code">Transport Protocol</span> to use. Hence, the source and target <span class="code">VFS</span> described above
        can be started by invoking, respectively, the following operations:</p>
      <div class="example"><pre>
1&gt; SVFS = cosFileTransferApp:create_VFS('FTP', [], Host, 21, [{protocol, tcp}]),
2&gt; TVFS = cosFileTransferApp:create_VFS({'NATIVE', 'cosFileTransferNATIVE_file'}, 
                                        [], OtherHost, 0, [{protocol, tcp}]),
      </pre></div>
      <p>Naturally can any combination of <span class="code">VFS</span>-types be used and it is also possible
        to use own drivers, i.e., <span class="code">{'NATIVE', 'MyDriver'}</span>.</p>
      <p>After creating necessary <span class="code">VFS's</span> we can login in and perform operations
        on files and directories residing on each file system.</p>
    

    <h4>How To Use SSL</h4>
      
      <p>To be able to use <span class="code">SSL</span> as transport protocol a few configuration
        parameters must be set. The required parameters depend on if Orber is
        the target or/and the source ORB. However, the SSL_CERT_FILE variable
        must be defined in both cases.</p>
      <p>Setting of a CA certificate file with an option does not work due to 
        weaknesses in the SSLeay package. A work-around in the ssl application is 
        to set the OS environment variable SSL_CERT_FILE before SSL is started. 
        However, then the CA certificate file will be global for all connections 
        (both incoming and outgoing calls).</p>

      <h4>Configurations when cosFileTransfer is Used as Target</h4>
        
        <p>The following three configuration variables can be used to configure
          cosFileTransfer's SSL target behavior.</p>
        <ul>
          <li>
<strong>ssl_server_certfile</strong> which is a path to a file containing a
           chain of PEM encoded certificates for cosFileTransfer as target.</li>
          <li>
<strong>ssl_server_verify</strong> which specifies type of verification: 
           0 = do not verify peer; 1 = verify peer, verify client once, 2 = 
           verify peer, verify client once, fail if no peer certificate. 
           The default value is 0.</li>
          <li>
<strong>ssl_server_depth</strong> which specifies verification depth, i.e.
           how far in a chain of certificates the verification process shall 
           proceed before the verification is considered successful. The
           default value is 1. </li>
        </ul>
        <p>There also exist a number of API functions for accessing the values of 
          these variables:</p>
        <ul>
          <li>cosFileTransferApp:ssl_server_certfile/0</li>
          <li>cosFileTransferApp:ssl_server_verify/0</li>
          <li>cosFileTransferApp:ssl_server_depth/0</li>
        </ul>
      

      <h4>Configurations when cosFileTransfer is used as Source</h4>
        
        <p>Below is the list of configuration variables used when cosFileTransfer
          act as the source application.</p>
        <ul>
          <li>
<strong>ssl_client_certfile</strong> which is a path to a file containing a
           chain of PEM encoded certificates used in outgoing calls.</li>
          <li>
<strong>ssl_client_verify</strong> which specifies type of verification: 
           0 = do not verify peer; 1 = verify peer, verify client once, 2 = 
           verify peer, verify client once, fail if no peer certificate. 
           The default value is 0.</li>
          <li>
<strong>ssl_client_depth</strong> which specifies verification depth, i.e. 
           how far in a chain of certificates the verification process shall
           proceed before the verification is considered successful. The
           default value is 1. </li>
        </ul>
        <p>There also exist a number of API functions for accessing the values of
          these variables in the client processes:</p>
        <ul>
          <li>cosFileTransferApp:ssl_client_certfile/0</li>
          <li>cosFileTransferApp:ssl_client_verify/0</li>
          <li>cosFileTransferApp:ssl_client_depth/0</li>
        </ul>
      
    
  
</div>
<div class="footer">
<hr>
<p>Copyright © 2000-2012 Ericsson AB. All Rights Reserved.</p>
</div>
</div>
</div></body>
</html>