# Hash with client IP - problem

**URL:** <https://community.wowza.com/t/hash-with-client-ip-problem/48400>\
**Category:** Wowza Streaming Engine\
**Created:** [March 28, 2017, 11:30am UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400 "2017-03-28T11:30:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pawel\_Andrzejczak](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pawel\_Andrzejczak](https://community.wowza.com/u/Pawel_Andrzejczak)\
**Post date:** [March 28, 2017, 11:30am UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/1 "2017-03-28T11:30:16Z")

</div>

Hi. I have WowzaStreamingEngine-4.2.0. I have application using securetoken2 with option “Include client IP address in hash generation”. I’m observing problem with ip address contains 2 digits (ex. 94.254.xxx.xxx). Then I get error

```auto
HTTPStreamerAdapterCupertinoStreamer.onPlaylist[live/mp4:myStream/playlist.m3u8?wowzatokenendtime=1490709720&wowzatokenstarttime=1490698920&wowzatokenhash=K93Wlv8C8RikCJAnq8ItjNMOpWqa_rxqftmcxubVHws=]: Session not accepted[1071131671]

```

On address wher every parts has 3 digits (xxx.xxx.xxx.xxx) the problem is no exist.

This is my code:

```auto
$ip = $_SERVER['HTTP_CLIENT_IP']?:($_SERVER['HTTP_X_FORWARDED_FOR']?:$_SERVER['REMOTE_ADDR']); 
$wowzastart = strtotime(date('d-m-Y H:i')); 
$wowzaend = strtotime(date('d-m-Y H:i')) + 10800; 
$secret = ' ****'; 
$wowzatokenprefix = 'wowzatoken'; 

$hashstr = hash('sha256', 'live/mp4:myStream?'.$ip.'&'.$secret.'&'.$wowzatokenprefix.'endtime='.$wowzaend.'&'.$wowzatokenprefix.'starttime='.$wowzastart.'', true); 

$usableHash= strtr(base64_encode($hashstr), '+/', '-_'); 

$url = "http://wowzaserver.com:1935/live/mp4:myStream/playlist.m3u8?".$wowzatokenprefix."endtime=".$wowzaend."&".$wowzatokenprefix."starttime=".$wowzastart."&".$wowzatokenprefix."hash=".$usableHash.""; 

```

It seems to be a problem with wowza.

Anyone can help me? What should I do?

---

<div class="post-metadata">

**Author:** ![Jermaine\_Hemby](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@Jermaine\_Hemby](https://community.wowza.com/u/Jermaine_Hemby)\
**Post date:** [April 2, 2017, 3:01pm UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/2 "2017-04-02T15:01:20Z")

</div>

Hello,

Thanks for contacting the Wowza Community!

If you take your custom code out the picture, do you see the issue with 2 digits instead of 3 digits?

regards,

Jermaine

---

<div class="post-metadata">

**Author:** ![Pawel\_Andrzejczak](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pawel\_Andrzejczak](https://community.wowza.com/u/Pawel_Andrzejczak)\
**Post date:** [April 3, 2017, 8:22am UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/3 "2017-04-03T08:22:07Z")

</div>

Yes, I think so. IP is the only difference. I don’t know why that is, but i think it’s a problem in wowza server.

p.s. On address where first part has 3 digits (xxx.xxx.xxx.xxx) the problem is no exist - on my ip xxx.xxx.180.3 ewerything working fine.

---

<div class="post-metadata">

**Author:** ![ayman\_gaber](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@ayman\_gaber](https://community.wowza.com/u/ayman_gaber)\
**Post date:** [October 9, 2018, 9:19pm UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/4 "2018-10-09T21:19:17Z")

</div>

i’m facing the same issue here, any update ?

---

<div class="post-metadata">

**Author:** ![Silencer](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Silencer](https://community.wowza.com/u/Silencer)\
**Post date:** [June 3, 2019, 2:22pm UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/5 "2019-06-03T14:22:02Z")

</div>

@Paweł Andrzejczak Change Hash Algorithm to SHA-512 .

But I also have a problem, when client use Ipv6 , that stream not working.

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [June 3, 2019, 2:32pm UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/6 "2019-06-03T14:32:05Z")

</div>

Wowza Streaming Engine supports IPv6; however, the computer that runs software must also support IPV6, and Java JDK 1.7 (or later) is required.

Let me know if that fixes things- thanks.

[https://www.wowza.com/docs/how-to-use-ipv6-networking-in-wowza-media-server-software](https://www.wowza.com/docs/how-to-use-ipv6-networking-in-wowza-media-server-software)

---

<div class="post-metadata">

**Author:** ![Silencer](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Silencer](https://community.wowza.com/u/Silencer)\
**Post date:** [June 3, 2019, 4:30pm UTC](https://community.wowza.com/t/hash-with-client-ip-problem/48400/7 "2019-06-03T16:30:47Z")

</div>

eg : when I access my stream with Ipv4 :

[http://wowza-ipaddress:1935/live/my.stream/playlist.m3u8?74.50.208.90&endtime=1559579520&starttime=0&hash=3IA3RRUIRcoplLotZeEgmvOtsJgOXoufuP2HVFcUJwv53uA-ZRk7B3kWEr2bJl1whXM7Hr-xHfcFC66kngmkJQ==](http://wowza-ipaddress:1935/live/my.stream/playlist.m3u8?74.50.208.90&endtime=1559579520&starttime=0&hash=3IA3RRUIRcoplLotZeEgmvOtsJgOXoufuP2HVFcUJwv53uA-ZRk7B3kWEr2bJl1whXM7Hr-xHfcFC66kngmkJQ==)

but with Ipv6 ( eg I use japan proxy - eg 45.32.63.123)

[http://wowza-ipaddress:1935/live/my.stream/playlist.m3u8?2001:19f0:7001:36ce:1520:e616:29f7:8944&endtime=1559579700&starttime=0&hash=coFvn2j83aZmAsHu0paNSG191wloglh9fniaDY2ugB9pt8\_93Gg44jbr89clGM5HROZsj1fpQNd-mFWPhpz2jA==](http://wowza-ipaddress:1935/live/my.stream/playlist.m3u8?2001:19f0:7001:36ce:1520:e616:29f7:8944&endtime=1559579700&starttime=0&hash=coFvn2j83aZmAsHu0paNSG191wloglh9fniaDY2ugB9pt8_93Gg44jbr89clGM5HROZsj1fpQNd-mFWPhpz2jA==)

stream link not working
