Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Support for HTTP/2 in Eclipse Titan
Support for HTTP/2 in Eclipse Titan [message #1773471] Thu, 28 September 2017 10:47 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 854
Registered: January 2015
Senior Member
Dear all,

HTTP2 is basically a more performant version of HTTP ,
supporting header field compression and allowing multiple concurrent exchanges on the same connection.
It also introduces unsolicited push of representations from servers to clients.
HTTP2 is an alternative to, but does not obsolete HTTP/1.1.

For details please check https://http2.github.io/

As test server I will use http://nghttp2.org/
which exposes a number of request/response test services at http://nghttp2.org/httpbin/

For instance, if one navigates to :

http://nghttp2.org/httpbin/get

will get something like

{
  "args": {},
  "headers": {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "Accept-Encoding": "gzip, deflate",
    "Accept-Language": "en-US,en;q=0.8",
    "Host": "nghttp2.org",
    "Upgrade-Insecure-Requests": "1",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",
    "Via": "1.1 nghttpx"
  },
  "origin": "91.82.100.59",
  "url": "http://nghttp2.org/httpbin/get"
}

and http://nghttp2.org/httpbin/ip
returns your IP address:

{
  "origin": "91.82.100.59"
}


The referring standard RFC 7540 ( see https://tools.ietf.org/html/rfc7540)
defines three ways to establish an HTTP2 connection:

1. Connection upgrade

3.2. Starting HTTP/2 for "http" URIs

A client that makes a request for an "http" URI without prior
knowledge about support for HTTP/2 on the next hop uses the HTTP
Upgrade mechanism (Section 6.7 of [RFC7230]). The client does so by
making an HTTP/1.1 request that includes an Upgrade header field with
the "h2c" token. Such an HTTP/1.1 request MUST include exactly one
HTTP2-Settings (Section 3.2.1) header field.

For example:

GET / HTTP/1.1
Host: server.example.com
Connection: Upgrade, HTTP2-Settings
Upgrade: h2c
HTTP2-Settings: <base64url encoding of HTTP/2 SETTINGS payload>

:
:
A server that supports HTTP/2 accepts the upgrade with a 101
(Switching Protocols) response. After the empty line that terminates
the 101 response, the server can begin sending HTTP/2 frames. These
frames MUST include a response to the request that initiated the
upgrade.

For example:

HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Upgrade: h2c

[ HTTP/2 connection ...



2. ALPN: application-layer protocol negotiation

Starting HTTP/2 for "https" URIs

A client that makes a request to an "https" URI uses TLS [TLS12] with
the application-layer protocol negotiation (ALPN) extension
[TLS-ALPN].

HTTP/2 over TLS uses the "h2" protocol identifier. The "h2c"
protocol identifier MUST NOT be sent by a client or selected by a
server; the "h2c" protocol identifier describes a protocol that does
not use TLS.

Once TLS negotiation is complete, both the client and the server MUST
send a connection preface (Section 3.5).



3. Previous knowledge

Starting HTTP/2 with Prior Knowledge

A client can learn that a particular server supports HTTP/2 by other
means. For example, [ALT-SVC] describes a mechanism for advertising
this capability.

A client MUST send the connection preface (Section 3.5) and then MAY
immediately send HTTP/2 frames to such a server; servers can identify
these connections by the presence of the connection preface. This
only affects the establishment of HTTP/2 connections over cleartext
TCP; implementations that support HTTP/2 over TLS MUST use protocol
negotiation in TLS [TLS-ALPN].


These three connection mechanisms can be made visible by using a up-to-date curl compiled together with nghttp2.
I have used curl 7.54.0 in the below experiments:

curl --version
curl 7.54.0 (x86_64-pc-linux-gnu) libcurl/7.54.0 OpenSSL/1.0.2g zlib/1.2.8 nghttp2/1.7.1
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy 

And here are the three HTTP2 mechanisms replicated with curl:


//ALPN
curl --http2 -v https://nghttp2.org/httpbin/ip 
*   Trying 139.162.123.134...
* TCP_NODELAY set
*   Trying 2400:8902::f03c:91ff:fe69:a454...
* TCP_NODELAY set
* Immediate connect fail for 2400:8902::f03c:91ff:fe69:a454: Network is unreachable
* Connected to nghttp2.org (139.162.123.134) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=nghttp2.org
*  start date: Sep 20 00:00:00 2017 GMT
*  expire date: Dec 19 00:00:00 2017 GMT
*  subjectAltName: host "nghttp2.org" matched cert's "nghttp2.org"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x1ca2f80)
> GET /httpbin/ip HTTP/2
> Host: nghttp2.org
> User-Agent: curl/7.54.0
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200 
< date: Thu, 28 Sep 2017 07:57:38 GMT
< content-type: application/json
< content-length: 31
< access-control-allow-origin: *
< access-control-allow-credentials: true
< x-backend-header-rtt: 0.002103
< strict-transport-security: max-age=31536000
< server: nghttpx
< via: 1.1 nghttpx
< x-frame-options: SAMEORIGIN
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
< 
{
  "origin": "91.82.100.59"
}
* Connection #0 to host nghttp2.org left intact





//upgrade connection

curl --http2 -v http://nghttp2.org/httpbin/ip 
*   Trying 139.162.123.134...
* TCP_NODELAY set
*   Trying 2400:8902::f03c:91ff:fe69:a454...
* TCP_NODELAY set
* Immediate connect fail for 2400:8902::f03c:91ff:fe69:a454: Network is unreachable
* Connected to nghttp2.org (139.162.123.134) port 80 (#0)
> GET /httpbin/ip HTTP/1.1
> Host: nghttp2.org
> User-Agent: curl/7.54.0
> Accept: */*
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAARAAAAAAAIAAAAA
> 
< HTTP/1.1 101 Switching Protocols
< Connection: Upgrade
< Upgrade: h2c
* Received 101
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=264
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200 
< date: Thu, 28 Sep 2017 07:59:24 GMT
< content-type: application/json
< content-length: 31
< access-control-allow-origin: *
< access-control-allow-credentials: true
< x-backend-header-rtt: 0.002284
< server: nghttpx
< via: 1.1 nghttpx
< x-frame-options: SAMEORIGIN
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
< 
{
  "origin": "91.82.100.59"
}
* Connection #0 to host nghttp2.org left intact


//prior knowledge


curl --http2-prior-knowledge -v  http://nghttp2.org/httpbin/ip
*   Trying 139.162.123.134...
* TCP_NODELAY set
*   Trying 2400:8902::f03c:91ff:fe69:a454...
* TCP_NODELAY set
* Immediate connect fail for 2400:8902::f03c:91ff:fe69:a454: Network is unreachable
* Connected to nghttp2.org (139.162.123.134) port 80 (#0)
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x80af80)
> GET /httpbin/ip HTTP/2
> Host: nghttp2.org
> User-Agent: curl/7.54.0
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200 
< date: Thu, 28 Sep 2017 08:00:05 GMT
< content-type: application/json
< content-length: 31
< access-control-allow-origin: *
< access-control-allow-credentials: true
< x-backend-header-rtt: 0.002401
< server: nghttpx
< via: 1.1 nghttpx
< x-frame-options: SAMEORIGIN
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
< 
{
  "origin": "91.82.100.59"
}
* Connection #0 to host nghttp2.org left intact


Support for HTTP in Titan comes in several, somewhat confusing forms:

The HTTP test port ( or rather the associated small protocol module):
https://github.com/eclipse/titan.TestPorts.HTTPmsg
supports HTTP 1.0/HTTP 1.1

The below confusingly named HTTP protocol module
https://github.com/eclipse/titan.ProtocolModules.HTTP2.0
again supports HTTP 1.0/HTTP 1.1 , but with more user-friendly structures, and it is considered version 2 relative to the one in the test port.

Finally git://git.eclipse.org/gitroot/titan/titan.ProtocolModules.HTTP2.git HTTP/2
is a genuine HTTP/2 implementation.

As in some of the scenarios the communication starts with HTTP 1.1 messages , I have used both the above protocol modules.
As transport I have again used the IPL4 of which you are probably bored to death already.

Here's the code deployed:

module HTTP2   {


modulepar {

  charstring tsp_hostname:="nghttp2.org"; 
  charstring tsp_url:="/httpbin/ip" ;
  Http2_start tsp_start:=alpn;
}

import from IPL4asp_Types all;
import from IPL4asp_PortType all;
import from HTTP_Types all;
import from HTTP_MessageLen all;
import from HTTP2_Types all;


//*************************************************************************
function f_HTTP2_Message_len(  in octetstring stream,   inout ro_integer args) return integer
//*************************************************************************
{    
  return f_HTTP2_msglen(stream, args) ;                 
}

type component GeneralComp
{
  port IPL4asp_PT p;
  timer t;    
  var IPL4asp_Types.Result  c_res:= { errorCode := omit, connId  := omit, os_error_code:=omit, os_error_text:= omit };   
}

type component SystemComp
{
  port IPL4asp_PT p;
}


type enumerated Http2_start
  {
    alpn (0),
    upgrade_conn (1),
    prior_knowledge(2)
  }

template  HTTP2_Frame t_HTTP2_init_settings_frame:= {
      settings_frame :={
		ack_flag :=false,
		settings := {
{
 setting_id:=2, //SETTINGS_ENABLE_PUSH
 setting_value:=0
},
{
 setting_id:=3, //SETTINGS_MAX_CONCURRENT_STREAMS
 setting_value:=100
},
{
 setting_id:=4,//SETTINGS_INITIAL_WINDOW_SIZE
 setting_value:=1073741824//65536
}
}

}
}




template  HTTP2_Frame t_HTTP2_window_update_frame:= {
      window_update_frame :={
		stream_id :=0,
		window_size_increment := 1073676289
		}
}


template  HTTP2_Frame t_HTTP2_init_settings_frame_r:= {
      settings_frame :={
		ack_flag :=false,
		settings := *
		}
}



template  HTTP2_Frame t_HTTP2_init_settings_frame_ack:= {
      settings_frame :={
		ack_flag :=true,
		settings := omit 
}
}


template  HTTP2_header_block t_HTTP2_header_block:= {
pseudo_headers :={
 method:="GET",
  scheme:="http",
  authority:=tsp_hostname,
  path:=tsp_url,
  status:=omit
},
 headers :={{
  header_name:="accept",
  header_value:="*/*"
},
{
  header_name:="user-agent",
  header_value:="Titan"
}
}
}

template  HTTP2_Frame t_HTTP2_data_frame(in octetstring pdu):= {
      data_frame :={
  stream_id:=1,
  end_stream_flag :=false,
  data:=pdu,
  padding:=omit
}
}


template  HTTP2_Frame t_HTTP2_header_frame(in octetstring pdu):= {
      header_frame:=
{
   stream_id:=1,
  end_stream_flag :=true,
  end_header_flag :=true,
  priority_data:=omit,
  header_block_fragment:=pdu,
  padding:=omit
}

 }


template  ASP_Send t_data1(in integer p_id ) :={
  connId:=p_id,
  proto:=omit,
  msg:=ef_HTTP_Encode(valueof(t_message("")))
}


template  ASP_Send t_data2(in integer p_id, in octetstring pdu ) :={
  connId:=p_id,
  proto:=omit,
  msg:=pdu
}


template HTTP_Message t_message (in charstring payload) := {
  msg := {{request_line :={GET,tsp_url,1,1}},{
      host := tsp_hostname,
      connection := {{"Upgrade"},{"HTTP2-Settings"}},
      upgrade := {{"h2c"}},
      http2_settings := "AAMAAABkAARAAAAAAAIAAAAA",
      user_agent := "Titan"

    },omit}
}with { optional "implicit omit" } 




 //*************************************************************************
testcase TC_http2() runs on GeneralComp system SystemComp {
 //*************************************************************************

  var ASP_RecvFrom v_ASP_RecvFrom;
  var IPL4asp_Types.Result  vl_result;
  var HTTP_Message v_HTTP_Message;		
  var HTTP2_Frame v_HTTP2_Frame;	
  var HTTP2_comp_context v_HTTP2_comp_context;
  var HTTP2_decoder_error_descr v_err;
  var octetstring v_data:=''O, v_msg:=''O;
  var integer v_cid , v_ret 

  
  
  map(self:p, system:p); 

  vl_result := c_res;

if(tsp_start == alpn){

    vl_result :=f_IPL4_connect(p, tsp_hostname, 443,"",0, -1, {ssl := {} }, {{alpn_list:={"h2"}},{tls_hostname:=tsp_hostname}}  )
 }

 else  
 {
  vl_result :=f_IPL4_connect( p, tsp_hostname, 80,"",0, -1, {tcp := {} }, {} )
 }
 
  log("connect result",vl_result)

  if (not(ispresent(vl_result.connId)))  {  log("Could not connect");   stop;  } 
  v_cid:=vl_result.connId ;

if(tsp_start==upgrade_conn)
{
//register message length function of HTTP with IPL4:

//*************************************************************************
 //var f_IPL4_getMsgLen getMsg_Func := refers(f_HTTPMessage_len);
 //f_IPL4_setGetMsgLen(p,v_cid, getMsg_Func, {});
//*************************************************************************
// send connection upgrade request
 p.send(t_data1(v_cid));
   t.start(5.0) 
     
       alt 
        { 
              [] p.receive(ASP_RecvFrom:?) -> value v_ASP_RecvFrom	{ 
              v_HTTP_Message:= ef_HTTP_Decode(v_ASP_RecvFrom.msg) 
              log(v_HTTP_Message)              
              };
              [] t.timeout{log("Bye")}
        } 

}  else {}

//--------------------------------------------------------------------------

//register message length function of HTTP/2 with IPL4:

  //*************************************************************************
  var f_IPL4_getMsgLen getMsg_Func := refers(f_HTTP2_Message_len);
  f_IPL4_setGetMsgLen(p,v_cid, getMsg_Func, {});
  //*************************************************************************
//init compression context
v_HTTP2_comp_context:=HTTP2_comp_context_init();
// send connection preface "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
p.send(t_data2(v_cid,HTTP2_connection_preface));
// send settings
p.send(t_data2(v_cid,f_HTTP2_encode_frame(valueof(t_HTTP2_init_settings_frame))));
// send window update
p.send(t_data2(v_cid,f_HTTP2_encode_frame(valueof(t_HTTP2_window_update_frame))));

if(not(tsp_start==upgrade_conn))
{
// send HEADER frame
HTTP2_comp_context_encode(v_HTTP2_comp_context,valueof(t_HTTP2_header_block), v_data )
//HTTP2_comp_context_decode(v_HTTP2_comp_context,v_HTTP2_header_block, v_data )
//log("v_HTTP2_header_block",v_HTTP2_header_block)
p.send(t_data2(v_cid,f_HTTP2_encode_frame(valueof(t_HTTP2_header_frame(v_data))))); 
}

  t.start(1.0) 

  alt 
  { 
    [] p.receive(ASP_RecvFrom:?) -> value v_ASP_RecvFrom { 
    
     f_HTTP2_decode_frame(v_ASP_RecvFrom.msg, v_HTTP2_Frame, v_err) 

     log("**********received frame:  ***********",v_HTTP2_Frame)
     
      if (ischosen(v_HTTP2_Frame.settings_frame))
      {
     if (match(v_HTTP2_Frame,t_HTTP2_init_settings_frame_ack ) ) 
     {  
     log("**********received init_settings_frame_ack   ") 
     repeat;
     } 
     else if  (match(v_HTTP2_Frame, t_HTTP2_init_settings_frame_r))
     {  
     log("**********received init_settings_frame    ") ;
     p.send(t_data2(v_cid,f_HTTP2_encode_frame(valueof(t_HTTP2_init_settings_frame_ack))));
     repeat;
     
     }
     
      }

    else  if (ischosen(v_HTTP2_Frame.header_frame))
      {
      log("**********received header frame    ") ;
        var HTTP2_header_block vl_HTTP2_header_block
    
    HTTP2_comp_context_decode(v_HTTP2_comp_context,vl_HTTP2_header_block, v_HTTP2_Frame.header_frame.header_block_fragment )
    
     log("************received header block:  ",vl_HTTP2_header_block)
     repeat;
      }

 else  if (ischosen(v_HTTP2_Frame.data_frame))
      {
           log("*************received data_frame    ") ;
      }

 else  if (ischosen(v_HTTP2_Frame.ping_frame))
      {
           log("*************received ping_frame    ") ;
      }

    };
    [] t.timeout{log("Bye")}

  }//endalt 

 HTTP2_comp_context_free(v_HTTP2_comp_context);
   
//----------------------------------------------------------------------------

  vl_result :=    f_IPL4_close(p, v_cid);
  log("close result",vl_result); 
  unmap(self:p, system:p); 
  setverdict(pass);

}//endtestcase


control{
execute(TC_http2());

}//endcontrol

}//endmodule  


with the following parameters

[MODULE_PARAMETERS]

HTTP2.tsp_hostname:="nghttp2.org" //"nghttp2.org"
HTTP2.tsp_url:="/httpbin/get" //"/httpbin/get" "/httpbin/ip"
HTTP2.tsp_start:=upgrade_conn //upgrade_conn, prior_knowledge, alpn


Of course I have cycled through the tsp_start parameters to reproduce all scenarios. In all the scenarios I have received the below answer:



01:12:55.447376 HTTP2.ttcn:357 **********received header frame    
01:12:55.448604 HTTP2.ttcn:362 ************received header block:  {
    pseudo_headers := {
        method := omit,
        scheme := omit,
        authority := omit,
        path := omit,
        status := 200
    },
    headers := {
        {
            header_name := "date",
            header_value := "Thu, 28 Sep 2017 08:12:55 GMT"
        },
        {
            header_name := "content-type",
            header_value := "application/json"
        }
    }
}
01:12:55.448926 HTTP2.ttcn:332 Matching on port p succeeded:  matched
01:12:55.448982 HTTP2.ttcn:332 Receive operation on port p succeeded, message from system(): @IPL4asp_Types.ASP_RecvFrom : {
    connId := 1,
    remName := "nghttp2.org",
    remPort := 80,
    locName := "192.168.139.129",
    locPort := 39655,
    proto := {
        tcp := { }
    },
    userData := 0,
    msg := '0000CE0001000000017B0A20202261726773223A207B7D2C0A20202268656164657273223A207B0A2020202022416363657074223A20222A2F2A222C0A2020202022486F7374223A20226E6768747470322E6F7267222C0A2020202022557365722D4167656E74223A2022546974616E222C0A2020202022566961223A202232206E676874747078220A20207D2C0A2020226F726967696E223A202239312E38322E3130302E3539222C0A20202275726C223A2022687474703A2F2F6E6768747470322E6F72672F6874747062696E2F676574220A7D0A'O
} id 4
01:12:55.449026 HTTP2.ttcn:332 Message with id 4 was extracted from the queue of p.
01:12:55.449050 HTTP2.ttcn:336 **********received frame:  ***********{
    data_frame := {
        stream_id := 1,
        end_stream_flag := true,
        data := '7B0A20202261726773223A207B7D2C0A20202268656164657273223A207B0A2020202022416363657074223A20222A2F2A222C0A2020202022486F7374223A20226E6768747470322E6F7267222C0A2020202022557365722D4167656E74223A2022546974616E222C0A2020202022566961223A202232206E676874747078220A20207D2C0A2020226F726967696E223A202239312E38322E3130302E3539222C0A20202275726C223A2022687474703A2F2F6E6768747470322E6F72672F6874747062696E2F676574220A7D0A'O ("{
  \"args\": {},
  \"headers\": {
    \"Accept\": \"*/*\",
    \"Host\": \"nghttp2.org\",
    \"User-Agent\": \"Titan\",
    \"Via\": \"2 nghttpx\"
  },
  \"origin\": \"91.82.100.59\",
  \"url\": \"http://nghttp2.org/httpbin/get\"
}
"),
        padding := omit
    }
} 


which is practically the same as the one obtained with a browser or curl.


Note1. The ALPN scenario requires support from the IPL4 port, see

IPL4asp Test Port for TTCN-3 Toolset with TITAN, Description

2.11.6 ALPN support
The test port supports the ALPN TLS extension and the ALPN negotiation.
Please note that the ALPN support requires OpenSSL 1.0.2 at least.
2.12 TLS hostname extension
The test port supports the TLS hostname extension as client only.

The TCP/TLS layer is established using the appropriate parameters:
if(tsp_start == alpn){

    vl_result :=f_IPL4_connect(p, tsp_hostname, 443,"",0, -1, {ssl := {} }, {{alpn_list:={"h2"}},{tls_hostname:=tsp_hostname}}  )
 }


Note2. In the "Upgrade Connection" scenario, communication starts on HTTP1.1, and then a connection upgrade is requested
(see also the previously published Websocket examples, which work along a similar logic)

The upgrade message template used here is:
template HTTP_Message t_message (in charstring payload) := {
  msg := {{request_line :={GET,tsp_url,1,1}},{
      host := tsp_hostname,
      connection := {{"Upgrade"},{"HTTP2-Settings"}},
      upgrade := {{"h2c"}},
      http2_settings := "AAMAAABkAARAAAAAAAIAAAAA",
      user_agent := "Titan"

    },omit}
}with { optional "implicit omit" } 




Note3: If one checks the decoded headers might notice that they are wrongly decoded:

23:41:55.096525 HTTP2.ttcn:357 **********received header frame    
23:41:55.097873 HTTP2.ttcn:362 ************received header block:  { pseudo_headers := { method := omit, scheme := omit, authority := omit, path := omit, status := 200 }, headers := { { header_name := "date", header_value := "Tue, 20 Jun 2017 06:41:56 GMT" }, { header_name := "content-type", header_value := "application/json" } } }

while Wireshark shows:

index.php/fa/30863/0/


In fact the decoder works correctly , but the headers contain extensions that are not (yet) covered.

Code and logs attached as usual.


Now, the main problem with the attached TTCN-3 code is the same I have highlighted in the STOMP/WebSocket/TCP example
(https://www.eclipse.org/forums/index.php/t/1088583/) :

there is no nice separation between the protocol layers in the TTCN-3 code;
next, we will look into a solution that is different from the usage of translation ports as proposed previously.


Best regards
Elemer

[Updated on: Sat, 30 September 2017 03:34]

Report message to a moderator

Re: Support for HTTP/2 in Eclipse Titan [message #1783014 is a reply to message #1773471] Tue, 06 March 2018 14:16 Go to previous messageGo to next message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 34
Registered: October 2015
Location: Montreal, Quebec, Canada
Member
Great post!

For people using Ubuntu 14.04, wireshark and curl updates were not easy to get.
For wireshark, I updated to this version and was able to decode http2 messages:
$ wireshark --version
Wireshark 2.4.4 (Git v2.4.4 packaged as 2.4.4-1~14.04.0)

And this is the recipe that worked for me to get the latest curl:

https://serversforhackers.com/c/curl-with-http2-support

Namely:

# Get build requirements
# Some of these are used for the Python bindings
# this package also installs
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
libjemalloc-dev cython python3-dev python-setuptools

# Build nghttp2 from source
git clone https://github.com/tatsuhiro-t/nghttp2.git
cd nghttp2
autoreconf -i
automake
autoconf
./configure
make
sudo make install

cd ~
sudo apt-get build-dep curl
wget http://curl.haxx.se/download/curl-7.46.0.tar.bz2
tar -xvjf curl-7.XX.X.tar.bz2
cd curl-7.XX.X
./configure --with-nghttp2=/usr/local --with-ssl
make
sudo make install
sudo ldconfig

That way, I was able to install curl 7.58:
$ curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.0.1f zlib/1.2.8 nghttp2/1.32.0-DEV librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy
ceajog@elx7506426x:~/Downloads/curl-7.58.0$

Cheers,
Gustavo.

[Updated on: Tue, 06 March 2018 14:19]

Report message to a moderator

Re: Support for HTTP/2 in Eclipse Titan [message #1783091 is a reply to message #1783014] Wed, 07 March 2018 18:14 Go to previous message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 34
Registered: October 2015
Location: Montreal, Quebec, Canada
Member
Do you need Wireshark 2.5 on ubuntu 14.04?

Here's how I installed it from source:

- download latest source: https://www.wireshark.org/#download
- sudo apt-get install build-essential checkinstall libcurl4-openssl-dev bison flex qt5-default qttools5-dev libssl-dev libgtk-3-dev libpcap-dev
- sudo apt-get install qttools5-dev-tools
- cd wireshark_source_dir
- ./configure
- make
- sudo make install
- sudo ldconfig

Sources:
http://linuxtechlab.com/install-wireshark-linux-centosubuntu/#comment-431
https://www.wireshark.org/lists/wireshark-dev/201608/msg00119.html
https://stackoverflow.com/questions/20450893/usr-lib-i386-linux-gnu-qt5-bin-lrelease-not-found-warning-target-is-empty

Cheers,
Gustavo.
Previous Topic:Graduation notice
Next Topic:Is Neon still required for Titan Eclipse plugin?
Goto Forum:
  


Current Time: Sun Nov 18 19:09:34 GMT 2018

Powered by FUDForum. Page generated in 0.02434 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top