I check again, ssl verify is off, this is not problem.
Login, getHash is working fine, conlssion communication and ssl is ok.
public function call($url, $method, $sid, $params, $headers,
$wraperName) {
log_message('error',__METHOD__.'::'.print_r(func_get_args(),true));
$this->error = false; $options = array ( CURLOPT_RETURNTRANSFER => true
// return web page , CURLOPT_HEADER => false // return headers ,
CURLOPT_FOLLOWLOCATION => true // follow redirects , CURLOPT_ENCODING =>
"UTF-8" // handle all encodings , CURLOPT_USERAGENT => "openmeetings" //
who am i , CURLOPT_AUTOREFERER => true // set referer on redirect ,
CURLOPT_CONNECTTIMEOUT => 120 // timeout on connect , CURLOPT_TIMEOUT =>
120 // timeout on response , CURLOPT_MAXREDIRS => 10 // stop after 10
redirects , CURLOPT_SSL_VERIFYPEER => 0 // Enable/Disable SSL Cert
checks , CURLOPT_SSL_VERIFYHOST => 0 // Enable/Disable hostname
verification ); if ($headers) { $options[CURLOPT_HTTPHEADER] = $headers;
} if ($method != RestMethod::GET && $method != RestMethod::POST) {
$options[CURLOPT_CUSTOMREQUEST] = $method; }
2020. 12. 09. 9:09 keltezéssel, Maxim Solodovnik írta:
Hello
On Wed, 9 Dec 2020 at 14:41, Varga Balázs <[email protected]
<mailto:[email protected]>> wrote:
Hi Guys!
I try it 5.1.0 REST and only work for me user/login, user/hash .
All request is bad 405 method not allowed.
I integrate this into my app:
https://github.com/openmeetings/openmeetings-moodle-plugin/blob/master/api
Try create dedicated SOAP user via soap (and login, and admin)
privileges.
What am i doing wrong?
I try this
/*openmeetings/services/room/getExternal*?&sid=e9496bfe-1816-4da8-aa56-876940140635
return http 404, if listening REST methods, this is available:
OM log empty.
I try ADD user */openmeetings/services/user/*: - bad, http 400
I try ADD user */openmeetings/services/user/add*: - bad, http 405
DEBUG -[231906] 2020-12-09 07:10:05.191188 31.46.87.73 -->
OmRestService::call::{"serviceResult":{"message":"8a6edabb-347c-4eb3-9869-64781aeb98d6","type":"SUCCESS"}}
ERROR -[231906] 2020-12-09 07:10:05.191279 31.46.87.73 -->
OmGateway::login::Array
(
[message] => 8a6edabb-347c-4eb3-9869-64781aeb98d6
[type] => SUCCESS
)
ERROR -[231906] 2020-12-09 07:10:05.191382 31.46.87.73 -->
OmRestService::call::Array
(
[0] => https://MYSERVER:5443/openmeetings/services/user/
[1] => POST
[2] => 8a6edabb-347c-4eb3-9869-64781aeb98d6
[3] =>
user=%7B%22address%22%3A%7B%22email%22%3A%22nemegyedi%40bla.bla%22%7D%2C%22login%22%3A%22teszt1%22%2C%22password%22%3A%22teszt1%22%2C%22firstname%22%3A%22Teszt%22%2C%22lastname%22%3A%22blabla%22%2C%22languageId%22%3A17%2C%22rights%22%3A%5B%22soap%22%2C%22room%22%5D%2C%22type%22%3A%22external%22%2C%22externalId%22%3A%22id01%22%2C%22externalType%22%3A%22Tesztgroup%22%7D&confirm=0
[4] =>
[5] => serviceResult
)
ERROR -[231906] 2020-12-09 07:10:05.221745 31.46.87.73 -->
OmRestService::call::Request OpenMeetings! OpenMeetings Service
failed and no response was returned. Additioanl info: Array
(
[url] =>
https://MYSERVER:5443/openmeetings/services/user/?&sid=8a6edabb-347c-4eb3-9869-64781aeb98d6
[content_type] =>
[http_code] => 400
[header_size] => 92
[request_size] => 642
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.02882
[namelookup_time] => 0.000218
[connect_time] => 0.000453
[pretransfer_time] => 0.024427
[size_upload] => 380
[size_download] => 0
[speed_download] => 0
[speed_upload] => 13571
[download_content_length] => 0
[upload_content_length] => 380
[starttransfer_time] => 0.028799
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 127.0.0.1
[certinfo] => Array
(
)
[primary_port] => 5443
[local_ip] => 127.0.0.1
[local_port] => 57762
[http_version] => 2
[protocol] => 2
[ssl_verifyresult] => 0
[scheme] => HTTPS
[appconnect_time_us] => 24364
[connect_time_us] => 453
[namelookup_time_us] => 218
[pretransfer_time_us] => 24427
[redirect_time_us] => 0
[starttransfer_time_us] => 28799
[total_time_us] => 28820
)
1
DEBUG -[231906] 2020-12-09 07:10:05.221918 31.46.87.73 -->
OmRestService::callcUrl error, verbose information:
* Trying 127.0.0.1:5443...
* TCP_NODELAY set
* Connected to MYSERVER (127.0.0.1) port 5443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
please check 2 lines above
you seems to have SSL issues
try to turn off SSL verification is CURL
these 2 options:
https://github.com/openmeetings/openmeetings-api-plugin/blob/master/src/main/scripts/OmRestService.php#L87
* Server certificate:
* subject: CN=MYSERVER
* start date: Nov 9 10:14:52 2020 GMT
* expire date: Feb 7 10:14:52 2021 GMT
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
> POST
/openmeetings/services/user/?&sid=8a6edabb-347c-4eb3-9869-64781aeb98d6
HTTP/1.1
Host: MYSERVER:5443
User-Agent: openmeetings
Accept: */*
Accept-Encoding: UTF-8
Content-Length: 380
Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 380 out of 380 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 400
< Date: Wed, 09 Dec 2020 07:10:05 GMT
< Content-Length: 0
< Connection: close
<
* Closing connection 0
I try create room */openmeetings/services**/room/add* http 405
OM log
DEBUG 12-09 07:23:17.282 o.a.o.w.UserWebService:107
[nio-5443-exec-5] - Login user
DEBUG 12-09 07:23:17.288 o.a.o.d.d.u.UserDao:616 [nio-5443-exec-5]
- login:: 1 users were found
DEBUG 12-09 07:23:18.529 o.a.o.d.u.AuthLevelUtil:40
[nio-5443-exec-5] - Level LOGIN :: [GRANTED]
DEBUG 12-09 07:23:18.530 o.a.o.d.d.u.UserDao:633 [nio-5443-exec-5]
- login user groups [GroupUser [id=3, moderator=false, group=Group
[id=1, name=MYSERVER, deleted=false], user=User [id=4,
firstname=null, lastname=null, login=soap, pictureuri=null,
deleted=false, languageId=17, address=Address [id=4, country=US,
street=null, town=null, zip=null, deleted=false,
[email protected] <mailto:[email protected]>,
phone=null], externalId=null, type=USER]]]
DEBUG 12-09 07:23:18.540 o.a.o.d.d.s.SessiondataDao:78
[nio-5443-exec-5] - create :: create
DEBUG 12-09 07:23:18.541 o.a.o.d.d.s.SessiondataDao:48
[nio-5443-exec-5] - startsession :: startsession
DEBUG 12-09 07:23:18.556 o.a.o.w.UserWebService:114
[nio-5443-exec-5] - Login user: 4
WARN 12-09 07:23:18.615
o.a.c.j.i.WebApplicationExceptionMapper:73 [nio-5443-exec-8] -
javax.ws.rs.ClientErrorException: HTTP 405 Method Not Allowed
at
org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117)
at
org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:168)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:516)
at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:181)
at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
I try create room */openmeetings/services**/room/* http 400
(attache my applog and om log)
ERROR -[242531] 2020-12-09 07:15:27.113168 31.46.87.73 -->
OmRestService::call::Array
(
[0] => https://MYSERVER:5443/openmeetings/services/room/
[1] => POST
[2] => e35afcc3-597c-48be-9b1a-53d84284b5bb
[3] => Array
(
[room] => {"capacity":18,"comment":"soap
created","name":"Szoba neve","redirectUrl":"http:\/\/MYSERVER"
<http:%5C/%5C/MYSERVER>,"type":"presentation"}
)
[4] =>
[5] => roomDTO
)
ERROR -[242531] 2020-12-09 07:15:27.275523 31.46.87.73 -->
OmRestService::call::Request OpenMeetings! OpenMeetings Service
failed and no response was returned. Additioanl info: Array
(
[url] =>
https://MYSERVER:5443/openmeetings/services/room/?&sid=e35afcc3-597c-48be-9b1a-53d84284b5bb
[content_type] =>
[http_code] => 400
[header_size] => 92
[request_size] => 299
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.16065
[namelookup_time] => 0.000259
[connect_time] => 0.000374
[pretransfer_time] => 0.021961
[size_upload] => 275
[size_download] => 0
[speed_download] => 0
[speed_upload] => 1718
[download_content_length] => 0
[upload_content_length] => 275
[starttransfer_time] => 0.021964
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 127.0.0.1
[certinfo] => Array
(
)
[primary_port] => 5443
[local_ip] => 127.0.0.1
[local_port] => 57792
[http_version] => 2
[protocol] => 2
[ssl_verifyresult] => 0
[scheme] => HTTPS
[appconnect_time_us] => 21892
[connect_time_us] => 374
[namelookup_time_us] => 259
[pretransfer_time_us] => 21961
[redirect_time_us] => 0
[starttransfer_time_us] => 21964
[total_time_us] => 160650
)
1
DEBUG -[242531] 2020-12-09 07:15:27.275671 31.46.87.73 -->
OmRestService::callcUrl error, verbose information:
* Trying 127.0.0.1:5443...
* TCP_NODELAY set
* Connected to MYSERVER (127.0.0.1) port 5443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: CN=MYSERVER
* start date: Nov 9 10:14:52 2020 GMT
* expire date: Feb 7 10:14:52 2021 GMT
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
> POST
/openmeetings/services/room/?&sid=e35afcc3-597c-48be-9b1a-53d84284b5bb
HTTP/1.1
Host: MYSERVER:5443
User-Agent: openmeetings
Accept: */*
Accept-Encoding: UTF-8
Content-Length: 275
Content-Type: multipart/form-data;
boundary=------------------------70873a577bed1189
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 400
< Date: Wed, 09 Dec 2020 07:15:27 GMT
< Content-Length: 0
< Connection: close
<
* Closing connection 0
OM log:
DEBUG 12-09 07:19:11.112 o.a.o.w.UserWebService:107
[nio-5443-exec-1] - Login user
DEBUG 12-09 07:19:11.120 o.a.o.d.d.u.UserDao:616 [nio-5443-exec-1]
- login:: 1 users were found
DEBUG 12-09 07:19:12.706 o.a.o.d.u.AuthLevelUtil:40
[nio-5443-exec-1] - Level LOGIN :: [GRANTED]
DEBUG 12-09 07:19:12.710 o.a.o.d.d.u.UserDao:633 [nio-5443-exec-1]
- login user groups [GroupUser [id=3, moderator=false, group=Group
[id=1, name=MYSERVER, deleted=false], user=User [id=4,
firstname=null, lastname=null, login=soap, pictureuri=null,
deleted=false, languageId=17, address=Address [id=4, country=US,
street=null, town=null, zip=null, deleted=false,
[email protected] <mailto:[email protected]>,
phone=null], externalId=null, type=USER]]]
DEBUG 12-09 07:19:12.720 o.a.o.d.d.s.SessiondataDao:78
[nio-5443-exec-1] - create :: create
DEBUG 12-09 07:19:12.720 o.a.o.d.d.s.SessiondataDao:48
[nio-5443-exec-1] - startsession :: startsession
DEBUG 12-09 07:19:12.731 o.a.o.w.UserWebService:114
[nio-5443-exec-1] - Login user: 4
WARN 12-09 07:19:12.761 o.a.c.j.u.InjectionUtils:614
[io-5443-exec-10] - Instance of class
org.apache.openmeetings.db.dto.room.RoomDTO can not be created
using static valueOf(String) or fromString(String) methods
WARN 12-09 07:19:12.762
o.a.c.j.i.WebApplicationExceptionMapper:73 [io-5443-exec-10] -
javax.ws.rs.WebApplicationException: HTTP 400 Bad Request
at
org.apache.cxf.jaxrs.utils.InjectionUtils.evaluateFactoryMethods(InjectionUtils.java:617)
at
org.apache.cxf.jaxrs.utils.InjectionUtils.handleParameter(InjectionUtils.java:514)
at
org.apache.cxf.jaxrs.utils.InjectionUtils.createParameterObject(InjectionUtils.java:1079)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processFormParam(JAXRSUtils.java:1057)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.createHttpParameterValue(JAXRSUtils.java:962)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:922)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:842)
--
Varga Balázs
+36-70-389-4753
SZHWEB Bt.
--
Best regards,
Maxim
--
Varga Balázs
+36-70-389-4753
SZHWEB Bt.